Level 104
Level 106
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.
Ignore?
var para = document.createElement("p");
creates a new <p> element
creates a text node:
var node = document.createTextNode("This is a new paragraph.");
para.appendChild(node);
append the text node to the <p> element:
element.appendChild(para);
appends the new element to the existing element:
parent.removeChild(child);
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:
parent.replaceChild(para,child);
Replacing HTML Elements