MCPcopy
hub / github.com/playcanvas/engine / addEvent

Function addEvent

tests/qunit/qunit.js:1359–1367  ·  view source on GitHub ↗
( elem, type, fn )

Source from the content-addressed store, hash-verified

1357}
1358
1359function addEvent( elem, type, fn ) {
1360 if ( elem.addEventListener ) {
1361 elem.addEventListener( type, fn, false );
1362 } else if ( elem.attachEvent ) {
1363 elem.attachEvent( "on" + type, fn );
1364 } else {
1365 fn();
1366 }
1367}
1368
1369function hasClass( elem, name ) {
1370 return (" " + elem.className + " ").indexOf(" " + name + " ") > -1;

Callers 1

qunit.jsFile · 0.85

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected