var slideSource = document.getElementById('slideSource'); document.getElementById('handle').onclick = function () { slideSource.classList.toggle('fade'); }