title: How to get closest form element of parent class. jQuery
body: <p>I am trying to add vote up buttons to my blog comments. I am looping through each comment like this:</p>
  
  <pre><code>.row
      for comment in Comments
          .row
              p #{comment}
              .votecell(style='width:30px;float:left;margin-left: 15px;')
                  .voteUp(id='#{comment.id}', style='margin-bottom: -17px;') &amp;#9650;
                              form.form-horizontal(id='voteUp', enctype="multipart/form-data", method='POST')
                                  input(type='hidden', name='_csrf', value=_csrf)
                                  input(type='hidden', name='commentID', value='#{comment.id}')
                                  &lt;br&gt;
  </code></pre>
  
  <p>Then using jQuery I am trying to submit the form that is a child of the button that was clicked. </p>
  
  <pre><code>$(".voteUp").click(function () {
      var form = $(this).closest(".form-horizontal")
      $(function(){
          $.ajax({
              url: '/voteUp', //the URL to your node.js server that has data
              type: 'POST',
              data:  form.serialize()
          }).done(function(data){
  
          }); 
      });
  });
  </code></pre>
  
  <p>The problem is it always submits the form from the first comment on the page no matter which voteUp button is clicked. I know this is because in jQuery $(this) == this[0], but I am unsure what other options are available to reference the clicked object. Anyone know how I can grab the child form of the clicked button?</p>
  
  <p>Here is what the html output looks like:</p>
  
  <pre><code>&lt;div id="5463ce6bd6e5e5d403e80b3f" style="margin-bottom: -17px;" class="voteUp"&gt;
      ▲
      &lt;form enctype="multipart/form-data" method="POST" class="form-horizontal"&gt;
          &lt;input type="hidden" name="_csrf" value="4JbLbnEcRvq7ZuAhpZCXavMq7JW/vnIZlxW/o="&gt;
          &lt;input type="hidden" name="commentID" value="5463ce6bd6e5e5d403e80b3f"&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>