1

Possible Duplicate:
jQuery get all divs which do not have class attribute

I need to select all elements that have no class defined. How do I do that with JQuery?

4

2 回答 2

5
$(':not([class])')

html, body, head但是,请注意,如果他们没有课程,这也会选择。

于 2012-07-16T01:50:03.050 回答
4

此查询将选择所有元素,然后过滤那些没有 class 属性的元素:$('*').not('[class]')

于 2012-07-16T01:49:12.163 回答