How can I remove a child node in HTML using JavaScript?

前端 未结 9 1360
野的像风
野的像风 2020-12-12 20:22

Is there a function like document.getElementById(\"FirstDiv\").clear()?

9条回答
  •  有刺的猬
    2020-12-12 20:57

    You should probably use a JavaScript library to do things like this.

    For example, MochiKit has a function removeElement, and jQuery has remove.

提交回复
热议问题