How can I get the current class of a div with jQuery?

后端 未结 11 441
挽巷
挽巷 2020-12-03 00:19

Using jQuery, how can I get the current class of a div called div1?

11条回答
  •  醉梦人生
    2020-12-03 01:06

    The addClass method in jQuery has a currentClass built in property. You can use it inside a function call. Like so:

    First div
    Second div
    Third div
    Fourth div

提交回复
热议问题