how to add an onclick event in javascript to a button code example
Example: how to add onclick event in javascript
var element = document.getElementById("elem");
element.onclick = function(event) {
console.log(event);
}
var element = document.getElementById("elem");
element.onclick = function(event) {
console.log(event);
}