Thursday, 19 September 2013

How to select all elements that don't have a class or id?

How to select all elements that don't have a class or id?

If I want to select the elements that don't have a class (but may have an
ID), the following
$(".entry-container ul:not([class])").addClass("list type-1"); works fine.
If I want to select the elements that don't have an ID (but may have a
class) the following
$(".entry-container ul:not([id])").addClass("list type-1"); works fine.
But what if I want to select all the elements that don't have a class AND
and an ID?

No comments:

Post a Comment