Correct usage of addEventListener() / attachEvent()?
The usage of both is similar, though both take on a slightly different syntax for the event parameter: addEventListener (mdn reference): Supported by all major browsers (FF, Chrome, Edge) obj.addEventListener(‘click’, callback, false); function callback(){ /* do stuff */ } Events list for addEventListener. attachEvent (msdn reference): Supported by IE 5-8* obj.attachEvent(‘onclick’, callback); function callback(){ /* … Read more