var $notification=document.querySelector("#edit_notify_message"); document.querySelector("#edit_notify_activate").addEventListener("change",function(){ if(this.checked){ $notification.style.display="block"; }else{ $notification.style.display="none"; } });