Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

delete dom elements

// select the target element
const e = document.querySelector("li:last-child");

// remove the list item
e.parentElement.removeChild(e);
Code language: JavaScript (javascript)
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #delete #dom #elements
ADD COMMENT
Topic
Name
4+1 =