Skip to content

Commit 99ccdb1

Browse files
committed
insertBefore()
1 parent dd743ed commit 99ccdb1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

13_insertBefore.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@ shp.classList.add('red');
1515
// insertBefore
1616
// rhp is element, and shp is location after rhp
1717
container.insertBefore(rhp, shp);
18+
19+
// replace child
20+
const heading6 = document.createElement('h3');
21+
const textmarine = document.createTextNode('The marine ford');
22+
heading6.appendChild(textmarine);
23+
// replace child new, old
24+
container.replaceChild(heading6, rhp);

0 commit comments

Comments
 (0)