Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (33 sloc) 1.323 kb
<?xml version="1.0"?>
<entry type="selector" name="next adjacent" return="">
<title>Next Adjacent Selector ("prev + next")</title>
<sample>prev + next</sample>
<argument name="prev" type="Selector">
<desc>Any valid selector.</desc>
<argument name="next" type="Selector">
<desc>A selector to match the element that is next to the first selector.</desc>
<desc>Selects all next elements matching "next" that are immediately preceded by a sibling "prev".</desc>
<p>One important point to consider with both the next adjacent sibling selector (<code>prev + next</code>) and the general sibling selector (<code>prev ~ siblings</code>) is that the elements on either side of the combinator must share the same parent.</p>
<desc>Finds all inputs that are next to a label.</desc>
<code><![CDATA[$("label + input").css("color", "blue").val("Labeled!")]]></code>
<input name="name" />
<input name="newsletter" />
<input name="none" />]]></html>
<category slug="selectors/hierarchy-selectors"/>
<category slug="version/1.0"/>
Jump to Line
Something went wrong with that request. Please try again.