var box = document.getElmeentById("box"); box.onclick = function() { this.style.background = "yellow"; }