var draw = document.getElementById('picture'); draw.onclick = function() { this.classList.toggle("drawing"); }