replacing div content with javascript

后端 未结 6 2170
悲&欢浪女
悲&欢浪女 2020-12-09 01:48

I\'m trying to do this with pure javascript, not with jquery. I have a div that has an id test and contains other divs inside it. How do I empty the content of

6条回答
  •  庸人自扰
    2020-12-09 02:11

    Off the top of my head, I think this should work....

    document.getElementById("test").innerHTML = "";
    

提交回复
热议问题