difference between toggleclass and addclass

后端 未结 4 987
無奈伤痛
無奈伤痛 2021-02-20 14:35

I am working with jquery and attempting to add a class to a table on the selection of that table row.

I was initially using the following code -

$(this)         


        
4条回答
  •  梦谈多话
    2021-02-20 15:13

    There's no need to pass a second argument to .addClass() - it will always add the class.

    If that's the behaviour you want, that's the right method.

提交回复
热议问题