edit onclick event

JavaScript
var submitButton = document.getElementById('submitButton');
submitButton.setAttribute('onclick',  'alert("hello");');
Source

Also in JavaScript: