Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add onclick event in javascript

var element = document.getElementById("elem");
element.onclick = function(event) {
  console.log(event);
}
 
PREVIOUS NEXT
Tagged: #add #onclick #event #javascript
ADD COMMENT
Topic
Name
8+4 =