Removing elements by class name?

后端 未结 16 1745
猫巷女王i
猫巷女王i 2020-11-27 12:06

I have the below code to find elements with their class name:

// Get the element by their class name
var cur_columns = document.getElementsByClassName(\'colu         


        
16条回答
  •  时光说笑
    2020-11-27 12:58

    Yes, you have to remove from the parent:

    cur_columns[i].parentNode.removeChild(cur_columns[i]);
    

提交回复
热议问题