You should use only `addEventListener` here.
The attachEvent part should be delegated to a polyfill library that the end user add to their page because they know they have to support a non-standard browser