title: Hiding a DIV on return of if/else statement
body: <p>I've been trying to hide this div ID <code>#signup</code> within this code I'm working in and can't seem to get it work with what I've been doing. Any good way of hiding this div ID by fading out and in return fading in the new div <code>#test</code>? Here's what I got!</p>
  
  <p>HTML (index)</p>
  
  <pre><code>     &lt;form id="signup" action="&lt;?=$_SERVER['PHP_SELF']; ?&gt;" method="get"&gt;
        &lt;fieldset&gt;
  
            &lt;label for="email" id="address-label"&gt;Email Address&lt;/label&gt;
            &lt;input type="text" name="email" id="email" /&gt;
            &lt;input type="image" src="i/join.jpg" name="submit" value="Join" class="btn" alt="Join" /&gt;
  
        &lt;/fieldset&gt;
      &lt;/form&gt;
  
      &lt;div id="response"&gt;
          &lt;? require_once('inc/store-address.php'); if($_GET['submit']){ echo storeAddress(); } ?&gt;
          &lt;div id="test"&gt;test&lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code>#test {display: none;}
  </code></pre>
  
  <p>JS/PHP (inc/store-address.php)</p>
  
  <pre><code>&lt;?php
  function storeAddress(){
  
      if($api-&gt;listSubscribe($list_id, $_GET['email'], '') === true) {
          // It worked!
      ( "#signup" ).hide( "slow" );   
      ( "#test" ).show( "slow" );
      }
  
      else {
          // An error ocurred, return error message   
          return 'Error: ' . $api-&gt;errorMessage;
      }
  
  }
  
  // If being called via ajax, autorun the function
  if($_GET['ajax']){ echo storeAddress(); }
  ?&gt;
  </code></pre>