Skip to content

Instantly share code, notes, and snippets.

@prof3ssorSt3v3
Created July 31, 2017 20:47
Show Gist options
  • Save prof3ssorSt3v3/a9a177da5acf358f94e7c355751204ba to your computer and use it in GitHub Desktop.
Save prof3ssorSt3v3/a9a177da5acf358f94e7c355751204ba to your computer and use it in GitHub Desktop.
//namespace1.js
let STEVE = {
colorDiv: function(ev){
let target = ev.currentTarget;
target.style.backgroundColor = 'purple';
target.style.color = 'white';
},
init: function(){
let divA = document.getElementById('output');
divA.addEventListener('mouseout', STEVE.colorDiv);
}
}
STEVE.init();
//let colorDiv, divA;
//
//colorDiv = function(ev){
// let target = ev.currentTarget;
// target.style.backgroundColor = 'purple';
// target.style.color = 'white';
//}
//
//divA = document.getElementById('output');
//
//divA.addEventListener('mouseout', colorDiv);
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment