title: jquery: How to make query just for one <div> element in a form
body: <p>The following code is to add a css class to  element, but this code will add this class to all  elements present in a form.</p>
  
  <pre><code>$("#user_text").change(function(){
  
    if($("#user_text").val().length &lt;= 6){
      $("div").addClass("has-error");
    }else{
      $("div").addClass();
    }
  });
  </code></pre>
  
  <p>I have 5 more  elements in my form but i want this code to work just for a particular  element. this is the HTML code for it:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
  
        &lt;label class="col-xs-4 control-label" for="user_text"&gt;Text&lt;/label&gt;
      &lt;div class="col-xs-4"&gt;  
        &lt;input class="form-control" id="user_text" name="user[text]" placeholder="Enter password" type="text" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;script&gt;
  $("#user_password").change(function(){
  
    if($("#user_password").val().length &lt;= 6){
      $("div").addClass("has-error");
    }else{
      $("div").addClass();
    }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Is there any way I can just use my code for the particular  element? little help...</p>