how to identify the id of an HTML element having a certain class
<p>I've my HTML codes as</p>

<pre><code>&lt;li&gt;&lt;button id="1" class="vote btn" type="button" /&gt;&lt;/li&gt;
&lt;li&gt;&lt;button id="2" class="voteUp btn" type="button" /&gt;&lt;/li&gt;  // Only button with class= voteUp
&lt;li&gt;&lt;button id="3" class="vote btn" type="button" /&gt;&lt;/li&gt;
&lt;li&gt;&lt;button id="4" class="vote btn" type="button" /&gt;&lt;/li&gt;
.
.
.
&lt;li&gt;&lt;button id="x" class="vote btn" type="button" /&gt;&lt;/li&gt;
</code></pre>

<p>Now through jquery, when I click any of these buttons, I want to find out the id of the button who has got the class 'voteUp'. (There will be only one button having this class).</p>

<p>How can I find it?? I'm trying to figure it out using <code>.hasClass()</code> but not successful till now. Kindly help.</p>

<p>UPDATE:</p>

<p>Actual HTML &amp; PHP codes</p>

<pre><code>&lt;li class="box"&gt;
    &lt;div class="temLine"&gt;This is the fifth line&lt;/div&gt;
    &lt;div class="pushUp"&gt;&lt;input id="line5" class="voteUpBtn vote" name="voteUp" type="button" /&gt;&lt;/div&gt;
     &lt;div class="userName clear"&gt;- by ptamzz&lt;/div&gt;
     &lt;div class="clear"&gt;&lt;/div&gt;
&lt;/li&gt;
</code></pre>

<p>Above code will be looped using PHP and a list will be generated. Like I said, one of the button (input here) will have a 'voteUp' class while all others have 'vote' class.</p>
