title: jQuery .hide() doesn't work in some browsers
body: <p>We are using jQuery .hide() to hide options in select inputs - when there are less than 31 days in a month. It works fine with Google Chrome and FireFox, but it doesn't work in Internet Explorer, Opera and Safari. Here is the JavaScript code we are using:</p>
  
  <pre><code>$(function() {
      // Show and hide days according to the selected year and month.
      function show_and_hide_days(fp_form) {
          var select_year= $(fp_form).find("select.value_year");
          var select_month= $(fp_form).find("select.value_month");
          var select_day= $(fp_form).find("select.value_day");
          var selected_year= parseInt($(select_year).val());
          var selected_month= parseInt($(select_month).val());
          var selected_day= parseInt($(select_day).val());
          var days_in_month= new Date(selected_year, selected_month, 0).getDate();
          if ((days_in_month &gt;= 28))
          {
              // If selected day is bigger than the number of days in the selected month, reduce it to the maximal day in this month.
              if (selected_day &gt; days_in_month)
              {
                  $(select_day).val(days_in_month);
              }
              // Show all the days in this month and hide days which are not in this month.
              $(select_day).find("option").each(function() {
                  var day= parseInt($(this).val());
                  if (day &lt;= days_in_month)
                  {
                      $(this).show();
                  }
                  else
                  {
                      $(this).hide();
                  }
              });
          }
      }
  
      // Show and hide all days in this page.
      function show_and_hide_all_days() {
          $("select.value_day").each(function() {
              var form= $(this).closest("form");
              // Show and hide days according to the selected year and month.
              show_and_hide_days(form);
          });
      }
  
      // Show and hide all days in this page.
      show_and_hide_all_days();
  
      $("select.value_year, select.value_month").live("change", function() {
          var form= $(this).closest("form");
          // Show and hide days according to the selected year and month.
          show_and_hide_days(form);
          return false;
      });
  });
  </code></pre>
  
  <p>Here is the HTML code:</p>
  
  <pre><code>&lt;select class="value_year"&gt;
      &lt;option value="2000"&gt;2000&lt;/option&gt;
      &lt;option value="2001"&gt;2001&lt;/option&gt;
      &lt;option value="2002"&gt;2002&lt;/option&gt;
      &lt;option value="2003"&gt;2003&lt;/option&gt;
      &lt;option value="2004"&gt;2004&lt;/option&gt;
      &lt;option value="2005"&gt;2005&lt;/option&gt;
      &lt;option value="2006"&gt;2006&lt;/option&gt;
      &lt;option value="2007"&gt;2007&lt;/option&gt;
      &lt;option value="2008"&gt;2008&lt;/option&gt;
      &lt;option value="2009"&gt;2009&lt;/option&gt;
      &lt;option value="2010"&gt;2010&lt;/option&gt;
      &lt;option value="2011"&gt;2011&lt;/option&gt;
      &lt;option value="2012" selected="selected"&gt;2012&lt;/option&gt;
      &lt;option value="2013"&gt;2013&lt;/option&gt;
  &lt;/select&gt;
  /
  &lt;select class="value_month"&gt;
      &lt;option value="1"&gt;01&lt;/option&gt;
      &lt;option value="2"&gt;02&lt;/option&gt;
      &lt;option value="3"&gt;03&lt;/option&gt;
      &lt;option value="4"&gt;04&lt;/option&gt;
      &lt;option value="5"&gt;05&lt;/option&gt;
      &lt;option value="6"&gt;06&lt;/option&gt;
      &lt;option value="7"&gt;07&lt;/option&gt;
      &lt;option value="8"&gt;08&lt;/option&gt;
      &lt;option value="9"&gt;09&lt;/option&gt;
      &lt;option value="10"&gt;10&lt;/option&gt;
      &lt;option value="11"&gt;11&lt;/option&gt;
      &lt;option value="12" selected="selected"&gt;12&lt;/option&gt;
  &lt;/select&gt;
  /
  &lt;select class="value_day"&gt;
      &lt;option value="1"&gt;01&lt;/option&gt;
      &lt;option value="2"&gt;02&lt;/option&gt;
      &lt;option value="3"&gt;03&lt;/option&gt;
      &lt;option value="4"&gt;04&lt;/option&gt;
      &lt;option value="5"&gt;05&lt;/option&gt;
      &lt;option value="6"&gt;06&lt;/option&gt;
      &lt;option value="7"&gt;07&lt;/option&gt;
      &lt;option value="8"&gt;08&lt;/option&gt;
      &lt;option value="9"&gt;09&lt;/option&gt;
      &lt;option value="10"&gt;10&lt;/option&gt;
      &lt;option value="11"&gt;11&lt;/option&gt;
      &lt;option value="12"&gt;12&lt;/option&gt;
      &lt;option value="13"&gt;13&lt;/option&gt;
      &lt;option value="14"&gt;14&lt;/option&gt;
      &lt;option value="15"&gt;15&lt;/option&gt;
      &lt;option value="16"&gt;16&lt;/option&gt;
      &lt;option value="17"&gt;17&lt;/option&gt;
      &lt;option value="18" selected="selected"&gt;18&lt;/option&gt;
      &lt;option value="19"&gt;19&lt;/option&gt;
      &lt;option value="20"&gt;20&lt;/option&gt;
      &lt;option value="21"&gt;21&lt;/option&gt;
      &lt;option value="22"&gt;22&lt;/option&gt;
      &lt;option value="23"&gt;23&lt;/option&gt;
      &lt;option value="24"&gt;24&lt;/option&gt;
      &lt;option value="25"&gt;25&lt;/option&gt;
      &lt;option value="26"&gt;26&lt;/option&gt;
      &lt;option value="27"&gt;27&lt;/option&gt;
      &lt;option value="28"&gt;28&lt;/option&gt;
      &lt;option value="29"&gt;29&lt;/option&gt;
      &lt;option value="30"&gt;30&lt;/option&gt;
      &lt;option value="31"&gt;31&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>We are using jQuery v1.8.3 (I upgraded to this version to test if it fixes the problem, but it doesn't).</p>
  
  <p>Thanks,
  Uri.</p>