Hola
Prueba así
Código Javascript
:
Ver originalfor(i=0;i<result.length;i++){
var boton=document.createElement("input");
boton.setAttribute('type','button');
boton.setAttribute('id',result[i]);
boton.setAttribute('value',result[i]);
boton.setAttribute('onclick', 'visualizar("'+result[i]+'")');
document.getElementById('divPersonal').appendChild(boton);
}
Suerte