JavaScript remove() doesn't work in IE

前端 未结 5 2023

I have the following code in JavaScript:

all_el_ul = document.getElementsByClassName(\'element_list\')[0];
div_list = all_el_ul.getElementsByTagName(\"div\")         


        
5条回答
  •  醉话见心
    2020-12-05 04:49

    Please try this. (Support all browsers)

    var child = document.getElementById(id);
    child.parentNode.removeChild(child);
    

提交回复
热议问题