<input id='test' type='button' value='Go' /> <script type="text/javascript"> document.getElementById('test').onclick= function(){ alert('Opa!') } </script>