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?
Try
$(".entry-container ul:not([id],[class])").addClass("list type-1");
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句