Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JS Event Handlers

//Assuming there is an element with ID='test' on the page
 
document.getElementById('test').onclick = function(e) {
  alert('Element clicked!');
};
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #JS #Event #Handlers
ADD COMMENT
Topic
Name
2+7 =