Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/12/2009, 13:16
elkevin
 
Fecha de Ingreso: abril-2006
Mensajes: 95
Antigüedad: 18 años, 1 mes
Puntos: 0
Respuesta: Modificar onClick con setAttribute (o algún similar)

Cita:
Iniciado por jackson666 Ver Mensaje
Esto esta mal
document.getElementById('boton2').setAttribute = ("onClick", "funcion2();");

Esto esta bien
document.getElementById('boton2').setAttribute("on Click", "funcion2();");
Muchas gracias por ayudarme colega!.

Ahí lo saqué andando!, y busqué una solución para IE6 también!, lo dejo por si a alguien le sirve:

- JavaScript:

Código:
document.getElementById('boton2').onclick = function () {funcion2()}; // IE 6

document.getElementById('boton2').setAttribute("onClick", "funcion2();"); // IE7+ FF
Saludos!, muchísimas gracias!.