How to change class for all elements retrieved by document.getElementsByClassName

前端 未结 4 852
灰色年华
灰色年华 2020-12-10 14:18

I have a table which contains 3 rows. Each row has the class: .myClass.

I then query for the table rows with document.getElementsByClassName(\'myC

4条回答
  •  伪装坚强ぢ
    2020-12-10 15:07

    Another option is populating a normal array with the elements and then iterate through this array. You will be able to chance the class names of the elements this way.

提交回复
热议问题