how to add onclick on button using js 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);
}