Disable input type submit when input text is empty
<p>I have this code:</p>

<pre><code>setInterval(function(){
  if($("#username_error").val() == "" &amp;&amp; $("#password_error").val() == "" &amp;&amp; $("#email_error").val() == ""){
    $('input[type="submit"]').removeAttr('disabled');
  } else {
    $('input[type="submit"]').attr('disabled','disabled');
  }
}, 10);
</code></pre>

<p>I need to disable the submit button if there are no errors for three divs. When I run this code, nothing happens. But if I do an <code>alert()</code> this <code>if</code> statement runs correctly. What am I doing wrong here?</p>
