Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/05/2016, 17:21
tazzwt
 
Fecha de Ingreso: marzo-2010
Mensajes: 432
Antigüedad: 14 años, 10 meses
Puntos: 11
pasar valor del input por una funcion

Como puedo pasar el valor del input text al alert por la funcion ?

Código HTML:
Ver original
  1. function myFunction2() {
  2.    
  3.     alert(document.getElementById(buscar).value);
  4. }
  5.  
  6.  
  7.  
  8. <p>
  9.  
  10.   Nombre: <input type="text" name="buscar" id="buscar"><br>
  11.   <button onclick="myFunction2()">Buscar</button>
  12.  
  13. </p>
__________________
Libro de HTML 5 + codigo fuente bajar aqui.