title: Using Jquery to slowly hide a div
body: <p>I'm trying to make some code which finds if a div exists, and if it does then have it fade away slowly. I have this to determine whether or not the div exists</p>
  
  <pre>
      if($('#error').length != 0)
   {
    $('#error').hide(500);
   }  
  </pre>
  
  <p>And that does work but only on a refresh, I've been attempting to put it in a timer like this: </p>
  
  <pre>
     var refreshId = setInterval(function()
     {
        if($('#error').length != 0)
   {
    $('#error').hide(500);
   }   
     }, 500);
  </pre>
  
  <p>But its not getting rid of the innerHTML! I have some code which on hover alters the innerHTML of the error div so I can fill it up, but for some reason this isn't working, any advice would help!</p>
  
  <p>Thank you!</p>