+ 1

DOM removing element

will this work ? why not? var parent=document.getElementById("div"); parent.removeChild(parent.childNodes[0]);

10th Dec 2017, 5:39 PM
Srivastava321
Srivastava321 - avatar
3 ответов
+ 1
try uploading a code
10th Dec 2017, 6:05 PM
᠌᠌Code X
᠌᠌Code X - avatar
0
Note the difference between .childNodes and .children. .childNodes might grab white space.
10th Dec 2017, 9:28 PM
1of3
1of3 - avatar
- 1
please link your code as I don't see any obvious problem
10th Dec 2017, 5:44 PM
John Wells
John Wells - avatar