javascript change onclick event dynamically code example
Example: edit onclick event
var submitButton = document.getElementById('submitButton');
submitButton.setAttribute('onclick', 'alert("hello");');
var submitButton = document.getElementById('submitButton');
submitButton.setAttribute('onclick', 'alert("hello");');