* @param {HTMLElement} elem * @param {string} type * @param {Function} fn
( elem, type, fn )
| 3169 | * @param {Function} fn |
| 3170 | */ |
| 3171 | function addEvent( elem, type, fn ) { |
| 3172 | if ( elem.addEventListener ) { |
| 3173 | |
| 3174 | // Standards-based browsers |
| 3175 | elem.addEventListener( type, fn, false ); |
| 3176 | } else if ( elem.attachEvent ) { |
| 3177 | |
| 3178 | // support: IE <9 |
| 3179 | elem.attachEvent( "on" + type, function() { |
| 3180 | var event = window.event; |
| 3181 | if ( !event.target ) { |
| 3182 | event.target = event.srcElement || document; |
| 3183 | } |
| 3184 | |
| 3185 | fn.call( elem, event ); |
| 3186 | }); |
| 3187 | } |
| 3188 | } |
| 3189 | |
| 3190 | /** |
| 3191 | * @param {Array|NodeList} elems |
no outgoing calls
no test coverage detected