document.body.onload = function(){ document.getElementById('button1').onclick = function(){ alert('CLICK'); }}