Remove a DOM Element
DOM using the removeChild() and remove() method.
Removing an element using the removeChild() method- First, select the target element that you want to remove using DOM methods such as
querySelector().
- Then, select the parent element of the target element and use the
removeChild()method.
Suppose that you have the following HTML document:

Comments
Post a Comment