index.js
function(element, ev, fn){
	if(element.addEventListener) 
		element.addEventListener(ev, fn, false);
	else element.attachEvent("on" + ev, fn);
}
function(element, ev, fn){
	if(element.addEventListener) 
		element.addEventListener(ev, fn, false);
	else element.attachEvent("on" + ev, fn);
}
function ( element , ev , fn ) { if ( element . addEventListener ) element . addEventListener ( ev , fn , false ) ; else element . attachEvent ( "on" + ev , fn ) ; }
Cross-browser event listener
Cross - browser event listener