title: How to show a hidden div with javascript when submitting a form?
body: <p>I'm not really familiar with jquery, but am trying to get a simple animated gif to show when a form is submitted. When clicking 'submit' to upload an image I want to show gif so that users know that image is being uploaded. The submit button has an id="submit" and also an onClick="return confirm('message')" </p>
  
  <p>I have the div code containing the gif:</p>
  
  <pre><code>&lt;div id="loading" style="display:none"&gt;
  
      &lt;img src="images/hand_timer2.gif" alt="loading" /&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>which is hidden. And it does show if I remove the style. Fair enough. But when I try to show it with the following javascript it doesn't show:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $(function(){
          $('#submit').click(function(){
          $('#loading').show();
  
          }); 
      });
  </code></pre>
  
  <p>I have </p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"    
  type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>in a separate PHP header file. As far as I can see it's the only reference to jquery library, but I do have other javascript codes that all work. I just can't get this one to work. Can anyone point out what I'm doing wrong and why I can't get the div to show gif when clicking submit?</p>