title: chaging the color of textbox
body: <p>I am trying to validate the sign up form using jquery. On error, i want the textbox color to change to red. But when users start writing in the textbox the color should be changed from red to default. I am able to change the color to red on error. But when user starts writing again in the textbox the color remains red. Here is the sample code which i have tried.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function () {
  $('#signup_form').validate({ // initialize the plugin
      rules: {
          firstName: {
              required: true,
             },
  
          mobile: {
                 required:true,
                 number: true,
                 minlength:10 
          },
  },
  messages: {
          firstName: "Enter Name",
          mobile: {
              required: "Enter Mobile No",
              number:"Enter valid mobile no",
              minlength: "Enter 10 digit mobile no"
           },
    },
   errorPlacement: function(error, element) {
  
           if (element.attr("name") == "firstName") {
              $('#firstName').css('border-color', 'red');
           $("#fname").html(error);
          }
          if (element.attr("name") == "mobile") {
              $('#phone').css('border-color', 'red');
              $("#mobile").html(error);
             }
   },
        errorElement : "i"
     });
   });
  &lt;/script&gt;
  </code></pre>