Published in: JavaScript
Cross-browser implementation of element.addEventListener(). Simple, straightforward, and functional.
Useage: addListener(window, 'load', myFunction);
// Cross-browser implementation of element.addEventListener() function addListener(element, type, expression, bubbling) { bubbling = bubbling || false; if(window.addEventListener) { // Standard element.addEventListener(type, expression, bubbling); return true; } else if(window.attachEvent) { // IE element.attachEvent('on' + type, expression); return true; } else return false; }
Comments
Subscribe to comments
You need to login to post a comment.

I need some code like this to listener when exactly form submit written by javascript. Somebody help me in urgent please! Thank you for your attention!!!