JS DOM: Remove an Element or Childen
Remove Child
-
parent.removeChild(oldNode)
Replace Child
-
parent.replaceChild(newNode, oldNode) -
Replaces the child node oldNode of parent with newNode.
🛑 WARNING: If newNode is in the same doc, move it to the new place.
Remove all children
Replace all children by text
DOM Element Methods
Get node
- JS DOM: Get Element by ID, Name, Class etc
- JS DOM: Get Current Script Element
- JS DOM: Get Parent, Child, Sibling
Loop thru nodes
Attributes
- JS DOM: Element Attribute Methods
- JS DOM: Class Attribute (get add remove toggle)
- JS DOM: Change HTML style attribute (for CSS)