jquery selection attribute present and child of element
<p>The task I have is to test if one or more children of an element has a given property if the markup is</p>

<pre><code>&lt;div&gt;
   &lt;div attributename="xyz" /&gt;
&lt;/div&gt;
</code></pre>

<p>then the test is true however if the markup is</p>

<pre><code>&lt;div&gt;
   &lt;div&gt;
      &lt;div attributename="xyz" /&gt;
   &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>then the result should be false.</p>

<p>so far I've gotten to </p>

<pre><code>$(":[attributename]",context);
</code></pre>

<p>but that will return true for both scenarios</p>
