Level 104 Level 106
Level 105

[No Typing] Creating Nodes

7 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

var para = document.createElement("p");
creates a new <p> element
creates a text node:
var node = document.createTextNode("This is a new paragraph.");
append the text node to the <p> element:
appends the new element to the existing element:
Removing the child from the parent:
var child = document.getElementById("p1"); child.parentNode.removeChild(child);
Find the child you want to remove, and use its parentNode property to find the parent:
Replacing HTML Elements