Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

addeventlistener javascript

// The anwer of Innocent Ibis is wrong!!
// It should not have a # for the ID seens we are using getElementById
var element = document.getElementById("id");
element.addEventListener('click', function(){
	console.log("click");
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #addeventlistener #javascript
ADD COMMENT
Topic
Name
5+5 =