title: Disabling / enabling button if inputs are empty on keyup
body: <p>I have a little script here that should enable/disable a button based on whether or not either of two inputs are blank. The button starts out disabled. When I enter a character into either input, the button is enabled. But when I delete the characters from the inputs, the button doesn't disable again. Any idea what I'm doing wrong?</p>
  
  <pre><code>&lt;input type="text" class="adults" name="adults" /&gt;
  &lt;input type="text" class="children" name="children" /&gt;
  &lt;button type="submit" class="calculate" disabled="disabled"&gt;Calculate&lt;/button&gt;
  &lt;script&gt;            
      jQuery("input").keyup(function() {
          if ((jQuery("input.adults").val() !== undefined) || (jQuery("input.children").val() !== undefined)) jQuery(".calculate").removeAttr("disabled");
          else jQuery(".calculate").attr("disabled", "disabled");
      });
  &lt;/script&gt;
  </code></pre>