<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Leo acá te paso lo que te comente ayer de las funciones anónimas. Así me han funcionado los eventos que tienen las etiquetas input (ya sean button, submit, reset, text, etc).<br>Cuando creo uno de estas etiquetas mediante código JavaScript para después agregarlas al html la única forma que encontré es esta:<br><br>while (i<Nombres.length)<br> { <br> //Crea boton Agregar, Modificar y Eliminar<br> botones = document.createElement('input'); <br> botones.type = 'button'; <br> botones.name = 'subbot'+i; <br> botones.value= Nombres[i];<br> botones.id=botones.name;<br> botones.style.marginLeft='25px';<br> linkid='../Admin/'+tagname.value+'/'+botones.value+'.php'<br><b> botones.onclick =(function(links){function(){document.location.href=links}})(linkid);</b><br> if(tagname.value=='relaciones' && i==1)<br> {<br> botones.disabled=true;<br> }<br> contenedor.appendChild(botones);<br> i++;<br> }<br><br><br>Si no lo hago de esta manera, por ejemplo haciendo:<br><b><br>botones.onclick =function(){document.location.href=links}</b>;<br><br>Cada vez que se hace click en cualquiera de todos los botones realiza la acción pero de el ultimo que se creo.<br><br><br>In his heart, in his eyes<br>In his soul, there’s no sign of thunder<br>Screams, can you hear the screaming<br>When another restless soul must die<br> </div></body>
</html>