how to capture a button click in the dom using javascript code example
Example: javascript onclick button
var button = document.querySelector('button');
button.onclick = function() {
//do stuff
}
var button = document.querySelector('button');
button.onclick = function() {
//do stuff
}