title: How do I check if no option is selected in a selectbox using jQuery?
body: <p>I am trying to see if an option was selected in a selectbox and if not, I want it to alert a string. I was referring to this link(<a href="https://stackoverflow.com/questions/149573/check-if-option-is-selected-with-jquery-if-not-select-a-default">Check if option is selected with jQuery, if not select a default</a>), but its not working.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;select id="language" name="language"&gt;
    &lt;option value=""&gt;&lt;/option&gt;
    &lt;option value="1"&gt;One&lt;/option&gt;
    &lt;option value="2"&gt;Two&lt;/option&gt;
    &lt;option value="3"&gt;Three&lt;/option&gt;
  &lt;/select&gt;
  
  if(!$("#language option:selected").length) {
    alert('no option is selected');
  }
  </code></pre>
  
  <p>I pretty much copied the linked answer, but it's still not working. What am I missing?</p>