Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vanilla js on click

var div = document.getElementById('myId');
div.addEventListener('click', function(e){
  console.log(this.getAttribute('id'))
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vanilla #js #click
ADD COMMENT
Topic
Name
3+7 =