title: Show message in div in submit form
body: <p>I'm trying to show() a div whenever the user submits the form. The whole site is one page. Currently when you submit it, the form is submitted, then .confirmation div shows up for about 1 second and then it goes away, the page refreshes and the div is gone.</p>
  
  <p>This is my HTML</p>
  
  <pre><code>    &lt;form id="contactform" class="col s12 l6" action="mailer.php" method="post" &gt;
  
        &lt;div class="confirmation"&gt;&lt;p&gt;Thanks for contacting us. We will be in touch with you shortly.&lt;/p&gt;&lt;/div&gt;
  
        &lt;div class="row"&gt;
          &lt;div class="input-field col s12"&gt;
            &lt;input name="inputName" type="text" class="validate"&gt;
            &lt;label for="inputName"&gt;Name&lt;/label&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="row"&gt;
          &lt;div class="input-field col s6"&gt;
            &lt;input name="inputEmail" type="email" class="validate"&gt;
            &lt;label for="inputEmail"&gt;Email&lt;/label&gt;
          &lt;/div&gt;
          &lt;div class="input-field col s6"&gt;
            &lt;input name="inputPhone" type="text" class="validate"&gt;
            &lt;label for="inputPhone"&gt;Phone&lt;/label&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="row"&gt;
          &lt;div class="input-field col s12"&gt;
            &lt;textarea class="materialize-textarea" name="inputMessage"&gt;&lt;/textarea&gt;
            &lt;label&gt;Message&lt;/label&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="row"&gt;
  
            &lt;button id="submit-button" class="btn waves-effect waves-light cyan col s6" type="submit"&gt;Submit
              &lt;i class="mdi-content-send right"&gt;&lt;/i&gt;
            &lt;/button&gt;
  
        &lt;/div&gt;
      &lt;/form&gt;
      &lt;script src="js/scripts.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code>.confirmation {
    display: none;
  }
  </code></pre>
  
  <p>This is my PHP</p>
  
  <pre><code>    &lt;?php
      /* Set e-mail recipient */
      $myemail = "krm218@gmail.com";
  
      /* Check all form inputs using check_input function */
      $name = $_POST['inputName'];
      $email = $_POST['inputEmail'];
      $phone = $_POST['inputPhone'];
      /* $inquiry = $_POST['inputInquiry']; */
      $message = $_POST['inputMessage'];
  
      /* Let's prepare the message for the e-mail */
  
      $subject = "Cleaning Services Contact or Estimate";
  
      $message = "
  
      Victorias Cleaning Services Contact Form
  
      Name: $name
      Email: $email
      Phone: $phone
  
      Message:
      $message
  
      ";
  
      /* Send the message using mail() function */
      mail($myemail, $subject, $message);
  
      /* Redirect visitor to the thank you page */
      header('Location: index.html#contact');
  
      exit();
      ?&gt;
  </code></pre>
  
  <p>and a scripts.js file </p>
  
  <pre><code>$('#submit-button').click(function(){
      $(".confirmation").show();
  });
  </code></pre>
  
  <p>Thanks in advance!!</p>