title: Removing a class from all input elements
body: <p>I want to remove a class from my input elements.I'm using <code>Data Annotations</code> in <code>MVC</code> and unobtrusive javascript for validation,anyway, when user clicks submit button I want to remove <code>valid</code> class from all input elements, because it change all unnecessary input's (non-required) valid (green border color) and it's not looking good.Anyway, I try this:</p>
  
  <pre><code>$("#submitBtn").click(function () {
      if ($(".input-validation-error").length == 0) { // if there is no error
          $(this).button('loading');     
      } else {
          $("input").each(function () {
              $(this).removeClass("valid");
          }); 
      }
  </code></pre>
  
  <p>And it didn't work, also tried:</p>
  
  <pre><code>$("input").removeClass("valid");
  </code></pre>
  
  <p>It didn't work either.And I thought maybe it's working before the validation and valid class adding after the click event automatically.So I try this:</p>
  
  <pre><code>setInterval(function() {
      $("input").each(function() {
          $(this).removeClass("valid");
      });
  }, 1000);
  </code></pre>
  
  <p>But still no success. I don't know jQuery very well, probably I'm missing something simple.What is the problem?</p>