Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js vanilla when i remove one object it removes all of them

function removeItem(e) {
    var target = e.target;
    if(target.tagName !== 'LI') return;
    target.parentNode.removeChild(target);
}
list.addEventListener('click', removeItem);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #vanilla #remove #object #removes
ADD COMMENT
Topic
Name
1+7 =