Hide isn't working in IE

Hide isn't working in IE

Hi,

This code works fine in Firefox, but in IE the fields don't "hide".  I have a pull-down menu that is supposed to allow the user to hide or display two form fields.  Any help is appreciated.

  1. <html>
  2. <head>
  3. <script type="text/javascript" src="jquery-1.4.2.js"></script>
  4. <script type="text/javascript" src="jquery.validate.js"></script> <!-- version 1.6 -->
  5. <script type="text/javascript"> 
  6. $(document).ready(function() {
  7.     $("#hideornot").change(function(){
  8.         var hideornot = $("#hideornot").val(); 

  9.         if (hideornot == "Y") {
  10.             $('#val2').hide('slow');            
  11.             $('#val3').hide('slow');
  12.         } else {
  13.             $('#val2').show('slow');
  14.             $('#val3').show('slow');
  15.         }
  16.     });
  17. }); 
  18. </script> 

  19. </head>
  20. <body>
  21.   <form action="thanks.html" method="post" >
  22.     <fieldset>
  23.       <ul>
  24.         <li><label for="hideornot">Hide or not?</label>
  25.           <select name="hideornot" id="hideornot">
  26.             <option value="Y" selected>Yes</option>
  27.               <option value="N">No</option>
  28.             </select>
  29.         <div id="val2">
  30.           <li><label for="val2">Val 2</label><input type="text" />
  31.         </div>
  32.         <div id="val3">
  33.           <li><label for="val3">Val 3</label><input type="text" />
  34.         </div>
  35.         <li><input class="submit" id="submit" type="submit" value="Submit">
  36.       </ul>
  37.     </fieldset>
  38.   </form>
  39. </body>
  40. </html>