<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='docs.xsl'?>
<docs>
<method cat='DOM/Traversing' type='jQuery' short='Get a set of elements containing the unique next siblings of each of the
matched set of elements.' name='next'>
<desc>Get a set of elements containing the unique next siblings of each of the
matched set of elements.

It only returns the very next sibling for each element, not all
next siblings.

You may provide an optional expression to filter the match.</desc>
<params type='String' name='expr'>
<desc>(optional) An expression to filter the next Elements with</desc>
</params>
<examples>
<desc>Find the very next sibling of each paragraph.</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt;</before>
<code>$("p").next()</code>
<result>[ &lt;p&gt;Hello Again&lt;/p&gt;, &lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt; ]</result>
</examples>
<examples>
<desc>Find the very next sibling of each paragraph that has a class "selected".</desc>
<before>&lt;p&gt;Hello&lt;/p&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt;</before>
<code>$("p").next(".selected")</code>
<result>[ &lt;p class="selected"&gt;Hello Again&lt;/p&gt; ]</result>
</examples>
</method></docs>
