Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

The element.onclick Property

let element = document.getElementById('addItem');
element.onclick = function() { 
  let newElement = document.createElement('li');
  document.getElementById('list').appendChild(newElement);
};
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #The #Property
ADD COMMENT
Topic
Name
5+8 =