add onclick function to an i 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);
}