<pclass="desc"><strong>Description: </strong>Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.</p>
<pclass="arguement"><strong>contained</strong>A DOM element to match elements against.</p>
</li>
</ul>
<divclass="longdesc">
<p>Given a jQuery object that represents a set of DOM elements, the <code>.has()</code> method constructs a new jQuery object from a subset of the matching elements. The supplied selector is tested against the descendants of the matching elements; the element will be included in the result if any of its descendant elements matches the selector.</p>
<p>Consider a page with a nested list as follows:</p>
<pre>
<ul>
<li>list item 1</li>
<li>list item 2
<ul>
<li>list item 2-a</li>
<li>list item 2-b</li>
</ul>
</li>
<li>list item 3</li>
<li>list item 4</li>
</ul>
</pre>
<p>We can apply this method to the set of list items as follows:</p>
<p>The result of this call is a red background for item 2, as it is the only <code><li></code> that has a <code><ul></code> among its descendants.</p>