Useful Links
Computer Science
Programming
By Language
JavaScript and the DOM
1. Introduction to the Document Object Model (DOM)
2. Selecting DOM Elements
3. Traversing the DOM Tree
4. Manipulating DOM Elements
5. Creating and Inserting DOM Elements
6. Handling Events
7. Working with Web Forms
8. Advanced DOM Concepts
Creating and Inserting DOM Elements
Creating New Nodes
createElement() Method
Creating Element Nodes
Setting Initial Properties
createTextNode() Method
Creating Text Nodes
Use Cases
createDocumentFragment() Method
Purpose and Benefits
Performance Optimization
Inserting Nodes
appendChild() Method
Appending to Parent
Moving Existing Nodes
insertBefore() Method
Positioning Relative to Siblings
Reference Node Requirements
Modern Insertion Methods
prepend() Method
append() Method
before() Method
after() Method
Browser Support
Advantages over Legacy Methods
Removing Nodes
removeChild() Method
Legacy Removal Approach
remove() Method
Modern Removal Approach
Browser Support
Detaching vs Deleting
Replacing Nodes
replaceChild() Method
replaceWith() Method
Use Cases and Patterns
Cloning Nodes
cloneNode() Method
Deep Cloning
Shallow Cloning
Event Listeners and Cloning
Use Cases
Previous
4. Manipulating DOM Elements
Go to top
Next
6. Handling Events