Given the following:
<ul id="list">
<li>Item 1</li>
<li class="active">Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
How can I select all but Item 2, AKA something like:
$("ul#list li!active")
What about $("ul#list li:not(.active)")
?
您可以使用它来选择所有li
元素而不使用class:
$('ul#list li:not([class])')
if (!$(row).hasClass("changed")) {
// do your stuff
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.