Get the first id based on category
<p>How to get the first id based the category</p>

<pre><code>&lt;ul&gt;
    &lt;li id="1" category="A"&gt;One&lt;/li&gt;
    &lt;li id="2" category="A"&gt;Two&lt;/li&gt;
    &lt;li id="3" category="B"&gt;Three&lt;/li&gt;
    &lt;li id="4" category="B"&gt;Four&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>from the above code i can get the first id by</p>

<pre><code>$('ul').find('li:first').attr('id');
</code></pre>

<p>Suppose i want to get first id based on category, how to get? In my case i want to get first id of category B.(<code>ans has to be 3</code>)</p>
