title: Checking if input value is not empty or default
body: <p>I'm look for an elegant way to check if input value is not empty and not default.</p>
  
  <p>For example let's say we have input with value <code>Username</code>, this is a default value, and once the user clicks on this input field <code>Username</code> would be deleted so user could enter what he wants. Just to make it clear this is how it would look when the page is loaded:</p>
  
  <p><code>&lt;input type="text" class="defaultValue" value="Username" /&gt;</code></p>
  
  <p>Now by default this field would never be empty, unless user would do something to make it empty, so just to make sure i need to check for both things. The way i would do this is very simple:</p>
  
  <pre><code>if($(".defaultValue").val().length == 0 || $(".defaultValue").val() == "Username")
     alert("Please enter your username");
  </code></pre>
  
  <p>So this works, but looks ugly as hell. And usually i need to deal with huge forms so my code gets really ugly and hard to manage because of this, any way to improve this?</p>
  
  <p>Thanks.</p>