jQuery Select Element that has no Class or ID

后端 未结 3 949
时光说笑
时光说笑 2020-12-21 07:41

Trying to find a selector to get all elements that have both no class, and no id set to them.

So far I have 2 different outputs depending on if there is a space in

3条回答
  •  没有蜡笔的小新
    2020-12-21 08:27

    $('*:not([id]):not([class])')
    

    Your withSpace will select elements that don't have a class and have a parent which don't have an id. Not sure about noSpace. UPDATE Oh, it's does the same thing as mine, actually. So, the answer is your last selector.

提交回复
热议问题