Jquery select containing div of target
<pre><code>&lt;div class="row"&gt;
    &lt;label for="txtTitle"&gt;Title&lt;/label&gt;
    &lt;div class="holder"&gt;
        &lt;div class="text-holder"&gt; &lt;span class="ico-error"&gt;&lt;/span&gt;&lt;span class="text"&gt; &lt;input id="txtTitle"
     runat="server" type="text" value="" /&gt;&lt;/span&gt;  &lt;span class="t-l"&gt;
     &lt;/span&gt;&lt;span class="b-l"&gt;&lt;/span&gt;&lt;span class="t-r"&gt;&lt;/span&gt;&lt;span class="b-r"&gt;&lt;/span&gt; 
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I have the following html.  I am planning on doing some Jquery validation on the input box.  If this is invalid I want to add the error class to the div</p>

<pre><code>        var isValid = true;
        var errorMessage = '';
        if ($('#&lt;%=txtTitle.ClientID %&gt;').val() == '') {
            $('#&lt;%=txtTitle.ClientID %&gt;').parent().parent().parent(".row").addClass("error");
            isValid = false;
            errorMessage += "Firstname is required\n";
        }
        return isValid;
</code></pre>

<p>I've tried to target the parent but see that this div is further up the parent heirachy. so tried to select up the heirachy with more parent tags, but think I am straying well off course from understanding the correct way to target the div.</p>
