title: Get first matching ancestor containing a specific class
body: <p>I am trying to iterate to the first ancestor containing the class ‘sys-form-row’.</p>
  
  <p>I am able to get the row containing class="sys-form-row" using the following: objBack = </p>
  
  <pre><code>$('#txtMyBox2').parent().parent();
  </code></pre>
  
  <p>This seems incredibly clumsy.  What I would like to do is something like this: </p>
  
  <p><code>$('#txtMyBox2').parents('.sys-form-row');</code>  or even <code>$('#txtMyBox2').closest('.sys-form-row');</code> however both fail and my current approach will not always work if additional div nesting is applied.
  Any help would be really appreciated.</p>