create:
Document ⟩ .createElement()arrow-up-right
insert:
new children:
Element ⟩
.insertAdjacentHTML()arrow-up-right - 👉 🗺️ 圖解 ⭐️
.append()arrow-up-right - append a set of Nodearrow-up-right objects or string (Textarrow-up-right) objects.
Node
Text
.prepend()arrow-up-right - insert before the first child.
Node ⟩ .appendChild()arrow-up-right
new siblings:
.before()arrow-up-right
.after()arrow-up-right
remove/replace:
.remove()arrow-up-right
.replaceWith()arrow-up-right
Node ⟩ .removeChild()arrow-up-right
elem.wrappedWith()
If an element is already in the document and you insert it somewhere else, it will be moved to the new location, not copied.
replit: table of contentsarrow-up-right
Last updated 3 years ago