Two ways: directly add events to objects, add events to nodes
For example, add an onclick event to an ID with tab1
The first case:
var t = document.getElementById("tab1");
t.onclick = function tst(){
alert ('');
}
Second case
var tb = document.getElementById("tab1");
if(window.addEventListener){ // Mozilla, Netscape, Firefox
td_value.addEventListener('click', alert('11'), false);
td_value.addEventListener('click', alert('12'), false);
} else { // IE
td_value.attachEvent('onclick' , function(){alert('21');});
td_value.attachEvent('onclick', function(){alert('2'2);});
}