Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (38 sloc) 1.49 KB
<?xml version="1.0"?>
<entry type="selector" name="not" return="">
<title>:not() Selector</title>
<argument name="selector" type="Selector">
<desc>A selector with which to filter by.</desc>
<desc>Selects all elements that do not match the given selector.</desc>
<p>All selectors are accepted inside <code>:not()</code>, for example: <code>:not(div a)</code> and <code>:not(div,a)</code>.</p>
<h3>Additional Notes</h3>
<p>The <code><a href="/not/">.not()</a></code> method will end up providing you with more readable selections than pushing complex selectors or variables into a <code>:not()</code> selector filter. In most cases, it is a better choice.</p>
<desc>Finds all inputs that are not checked and highlights the next sibling span. Notice there is no change when clicking the checkboxes since no click events have been linked.</desc>
$("input:not(:checked) + span").css("background-color", "yellow");
$("input").attr("disabled", "disabled");
<input type="checkbox" name="a" />
<input type="checkbox" name="b" />
<input type="checkbox" name="c" checked="checked" />
<category slug="selectors/basic-filter-selectors"/>
<category slug="version/1.0"/>
Jump to Line
Something went wrong with that request. Please try again.