MCPcopy
hub / github.com/10bestdesign/jqvmap / addEvent

Function addEvent

tests/qunit/qunit.js:3171–3188  ·  view source on GitHub ↗

* @param {HTMLElement} elem * @param {string} type * @param {Function} fn

( elem, type, fn )

Source from the content-addressed store, hash-verified

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

Callers 4

addEventsFunction · 0.85
toolbarLooseFilterFunction · 0.85
toolbarModuleFilterFunction · 0.85
qunit.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected