title: DOM Elements with same id and jQuery
body: <p>Hi I have multiple elements with the same structure in my application. Second div element's id varies as per the comment id in the db which is unique. There are elements with the id 'vote_up' and 'vote_down'. This gets repeated for each comment.What happens is that, as I mentioned, there are multiple comments. I want to perform an Ajax request. First of this structure functions properly using ajax, but the rest does an http request. Btw I am developing a rails application and I am using jQuery.</p>
  
  <pre><code>&lt;div id="post_comment"&gt;
  john&lt;i&gt; says &lt;/i&gt; Comment&lt;br/&gt;
  
  &lt;div id="comment_10_div"&gt;
  **&lt;form action="/comments/vote_up" id="vote_up" method="post"&gt;**
           &lt;div style="margin:0;padding:0;display:inline"&gt;
                 &lt;input name="authenticity_token" type="hidden" 
                 value="w873BgYHLxQmadUalzMRUC+1ql4AtP3U7f78dT8x9ho=" /&gt;
           &lt;/div&gt;
       &lt;input id="Comment_place_id" name="Comment[post_id]" type="hidden" value="3" /&gt;
       &lt;input id="Comment_id" name="Comment[id]" type="hidden" value="10" /&gt;
       &lt;input id="Comment_user_id" name="Comment[user_id]" type="hidden" value="2" /&gt;
       &lt;input name="commit" type="submit" value="Vote up" /&gt;
  &lt;/form&gt;
  
  &lt;label id="comment_10"&gt;10&lt;/label&gt;
  
  **&lt;form action="/comments/vote_down" id="vote_down" method="post"&gt;**
          &lt;div style="margin:0;padding:0;display:inline"&gt;
              &lt;input name="authenticity_token" type="hidden" 
              value="w873BgYHLxQmadUalzMRUC+1ql4AtP3U7f78dT8x9ho=" /&gt;
          &lt;/div&gt;
      &lt;input id="Comment_place_id" name="Comment[place_id]" type="hidden" value="3" /&gt;
  
      &lt;input id="Comment_id" name="Comment[id]" type="hidden" value="10" /&gt;
      &lt;input id="Comment_user_id" name="Comment[user_id]" type="hidden" value="2" /&gt;
      &lt;input name="commit" type="submit" value="Vote Down" /&gt;
  &lt;/form&gt;
  &lt;/div&gt;      
  </code></pre>
  
  <p></p>
  
  <p>Can you please help me to solve this
  Thanks</p>