Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/07/2010, 15:50
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 3 meses
Puntos: 126
Respuesta: Botón con onclick dinámico

Hola

Prueba así

Código Javascript:
Ver original
  1. for(i=0;i<result.length;i++){
  2.                 var boton=document.createElement("input");
  3.                 boton.setAttribute('type','button');
  4.                 boton.setAttribute('id',result[i]);
  5.                 boton.setAttribute('value',result[i]);
  6. boton.setAttribute('onclick', 'visualizar("'+result[i]+'")');
  7.                 document.getElementById('divPersonal').appendChild(boton);
  8.  
  9.             }

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />