[Edit]
+
0
-
0
js remove last child
1 2 3 4 5 6 7 8 9 10 11 12 13 14<!doctype html> <html> <body> <div id="parent"><p>Child 1</p><p>Child 2</p></div> <script> var parent = document.querySelector("#parent"); parent.removeChild(parent.lastChild); // Warning: parent.lastChild can return text node with white characters (spaces, newlines, tabulators, etc.) </script> </body> </html>