title: JQuery: onchange event
body: <p>Trying to show/hide a text file based on the users selection in a select. I believe my problem is with the if statement.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;
  &lt;/script&gt;
  
  &lt;script&gt;
  $(document).ready(function(){
    $("#drpStatus").change(function(){
      if( $(this).val() == 'Married'){
        $("#txtSpouse").show();
      else
        $("#txtSpouse").hide();
    });
  });
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;input type="text" id="txtSpouse" style="display:none"&gt;
  &lt;select name="drpStatus" id="drpStatus"&gt;
              &lt;option value="Single" selected="selected"&gt;Single&lt;/option&gt;
              &lt;option value="Dating"&gt;Dating&lt;/option&gt;
              &lt;option value="Married"&gt;Married&lt;/option&gt;
            &lt;/select&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>