Skip to content

Instantly share code, notes, and snippets.

@projektorius96
Created January 17, 2019 07:12
Show Gist options
  • Save projektorius96/0b25dc899cce2bd0046a1879c9078c79 to your computer and use it in GitHub Desktop.
Save projektorius96/0b25dc899cce2bd0046a1879c9078c79 to your computer and use it in GitHub Desktop.
eListener-with-parameters for [object Window] (console.log example)
function eHandler(e, addCustomColor) {
var objTarget = e.target;
objTarget.style.backgroundColor = addCustomColor;}
var variableWin = this; // keyword THIS represent [object Window] in JS
variableWin.addEventListener('mouseover', function (e) {
eHandler (e, 'yellow'); }, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment