Last active
January 17, 2019 07:17
-
-
Save projektorius96/2b251c2d5c70e5da2aa788dcb7de154a to your computer and use it in GitHub Desktop.
eListener-with-parameter for [object Window] (console.log example)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function eHandler(eventObjectParameterGoes1st) { | |
/* var objTarget = eventObjectParameterGoes1st.target; | |
objTarget.style.backgroundColor = "yellow"; */ | |
eventObjectParameterGoes1st.target.style.backgroundColor = "yellow"; // _if using shortcut | |
} | |
var variableWin = this; // keyword THIS represent [object Window] in JS | |
variableWin.addEventListener('mouseover', function (eventObjectParameterGoes1st) { | |
eHandler (eventObjectParameterGoes1st); }, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment