title: Selecting comment above the DOM element
body: <p>Got a question. I've got this HTML:</p>
  
  <p><img src="https://i.stack.imgur.com/NpHS9.png" alt="enter image description here"></p>
  
  <p>I press a button (which is the 'editcurrent' class) which makes something appear. That works all, but I want to check which comment is above the control-group, I want to get the value of the comment so I can decide what I want to show to the user. But how do i get this value, with closest or parent? (i'm using jQuery)</p>
  
  <p>I got this code:</p>
  
  <pre><code>var comments = $('.form-horizontal').contents().filter(function(){ return this.nodeType===8; })
  </code></pre>
  
  <p>this gives me all the comments of the form. But I don't really know how to use the closest method with searching for comments.</p>
  
  <pre><code>console.log($(this).closest('.control-group').children(this.nodeType===8));
  </code></pre>
  
  <p>This is obviously not working... Could someone help me out?</p>