Changing background color of all elements with the same class

后端 未结 3 1350
天命终不由人
天命终不由人 2020-12-11 16:17

I have a link and a table row that have matching classes. When the link is clicked, I would like to change the background color of the row with the same class. For each ca

3条回答
  •  半阙折子戏
    2020-12-11 17:02

    You can also do it easily without jQuery with querySelectorAll():

    
    
    change first row
    change second
    
    

    提交回复
    热议问题
    test1
    test2