Add event:
//For example addListener(document,"click ",function(){alert('A Huinan')})
function addListener(element,e,fn){
if(element.addEventListener){
element.addEventListener(e,fn, false);
} else {
element.attachEvent("on" e,fn);
}
}
Get the source element:
function(evt){
var evt = window.event?window. event:evt,target=evt.srcElement||evt.target;}