Javascript removeChild(): delete node

removeChild() method is used to delete a child node of the parent node.

Syntax:
parent.removeChild(thisNode)
Parameter description:

QQ截图20161013112729.png

For example, delete id=" demo" node statement is:

var thisNode=document.getElementById("demo"); thisNode.parentNode.removeNode(thisNode);

For example, delete the node:

点击删除我

It can be seen that although Javascript only provides one method to delete nodes, it is enough.

Continuing Learning
||
无标题文档
点击删除我
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!