Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/06/2011, 07:30
Avatar de Naahuel
Naahuel
 
Fecha de Ingreso: marzo-2011
Ubicación: localhost
Mensajes: 796
Antigüedad: 13 años, 2 meses
Puntos: 192
Respuesta: Al hacer clic en Href enviar el valor a un input

Así?

Ver: http://jsbin.com/ucika3

Código:
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.  
  3. <meta charset=utf-8 />
  4.   function llenarInput(butt){
  5.     var valor = butt.innerHTML;
  6.     var inputUno = document.getElementById('inputUno');
  7.     var inputDos = document.getElementById('inputDos');
  8.    
  9.     if(inputUno.value==''){inputUno.value = valor;}    
  10.     else if(inputDos.value==''){inputDos.value = valor;}
  11.  
  12.   }
  13. </head>
  14.   <button onclick="llenarInput(this)" >1</button>
  15.   <button onclick="llenarInput(this)" >2</button>
  16.   <button onclick="llenarInput(this)" >3</button>
  17.  
  18.   <input type="text" id="inputUno" />
  19.   <input type="text" id="inputDos" />
  20. </body>
  21. </html>
__________________
nahueljose.com.ar