Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/05/2009, 17:48
posman
 
Fecha de Ingreso: enero-2008
Mensajes: 614
Antigüedad: 16 años, 4 meses
Puntos: 57
Respuesta: Agregar evento OnClick

No estoy muy seguro pero creo que es asi.

En Internet Explorer
Código:
document.getElementById('texto').attachEvent("onclick",function() {
  alert("onclick");
})
o
Código:
document.getElementById('texto').attachEvent("onclick",mifuncion);
function mifuncion() {
  alert("onclick");
})
En FireFox
Código:
document.getElementById('texto').addEventListener("click",mifuncion);