jQuery: selector (classname with space)

后端 未结 4 1184
清歌不尽
清歌不尽 2020-11-29 21:23

I\'m trying to get a div which has \"panel current\" as classname. The problem is the space - how can I select it?

4条回答
  •  余生分开走
    2020-11-29 21:29

    Class names can't have spaces in them. What you have there is two classes:

    This div has two classes: panel and current. That's easily selected:

    $("div.panel.current")...
    

    That means select all divs that have class panel and class current.

提交回复
热议问题