This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// written by Dean Edwards, 2005 | |
// with input from Tino Zijdel, Matthias Miller, Diego Perini | |
// http://dean.edwards.name/weblog/2005/10/add-event/ | |
function addEvent(element, type, handler) { | |
if (element.addEventListener) { | |
element.addEventListener(type, handler, false); | |
} else { | |
// assign each event handler a unique ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// written by Dean Edwards, 2005 | |
// with input from Tino Zijdel, Matthias Miller, Diego Perini | |
// http://dean.edwards.name/weblog/2005/10/add-event/ | |
function addEvent(element, type, handler) { | |
if (element.addEventListener) { | |
element.addEventListener(type, handler, false); | |
} else { | |
// assign each event handler a unique ID |