javascript - When one calls addEventListener without a target element what element does it default to? -
addeventlistener("load", run); function run() { //code } the above code appears work when try in web browser. guess because if 1 uses addeventlistener without target element defaults window object?
can confirm this?
global functions attached global object, window.
addeventlistener("load", run); is same as
window.addeventlistener("load", run); just alert same window.alert
Comments
Post a Comment