Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/02/2013, 14:44
marco64yes
 
Fecha de Ingreso: septiembre-2010
Mensajes: 350
Antigüedad: 14 años, 4 meses
Puntos: 9
Respuesta: getElementsByTagName No me esta funcionando

Ya vi como es, el evento click es con parentesis xD .click()

Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
<
html>
<
head>

    <
title>Untitled</title>
     <
script>

document.write("<input type='button' value='Ok' onClick='cambia()' />");
function 
cambia(){
alert("IN");    
}
function 
test(){
alert("onload In");
var 
inputs document.getElementsByTagName("input");

for (var 
0inputs.lengthi++) {
alert(inputs[i].type);
    if (
inputs[i].type === 'button') {
    
inputs[i].click();
        
//inputs[i].disabled = true;
    
}
}

}
    
</script>
</head>
 
<body onload="test()">


</body>
</html>