Skip to content

Instantly share code, notes, and snippets.

@projektorius96
Last active January 17, 2019 07:17
Show Gist options
  • Save projektorius96/2b251c2d5c70e5da2aa788dcb7de154a to your computer and use it in GitHub Desktop.
Save projektorius96/2b251c2d5c70e5da2aa788dcb7de154a to your computer and use it in GitHub Desktop.
eListener-with-parameter for [object Window] (console.log example)
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