title: Fade in and out a page with delay - jquery
body: <p>I can't manage to reload my page with jquery after the click function. the assignment is to use a click function with the a tag in the body tag. the a tag must fade and reload the same page. So the following things are needed:</p>
  
  <p>• Give the page to be loaded as an argument to the onclick function. <br>
  • Fading out itself takes 1.5 seconds. <br>
  • After fading out, you can load a page stored in the variable url with the following command:
  <code>window.location.href = url;</code></p>
  
  <p>Write the jQuery code to hide the page after loading the web page. Then you ensure that the page arrives in 1.5 seconds.</p>
  
  <p>So I tried these things... </p>
  
  <pre><code>Function's like: $("a").click(function(){
      $("p").fadeToggle();
      $("p").fadeToggle("slow");
      $("p").fadeToggle(1500);
  </code></pre>
  
  <p>I've also tried to use fadeIn and fadeOut in the code, but it doesn't help..</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="jquery-3.4.1.min.js"&gt;&lt;/script&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Jquery&lt;/title&gt;
    &lt;script&gt;$(document).ready(function(){
      $('a').click(function(e) {
      e.preventDefault();
      newLocation = this.href;
      $('p').fadeOut('slow', newpage);
      });
      function newpage() {
      window.location.href = url;
      }
      });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;Click &lt;a href="#"&gt;here&lt;/a&gt; to reload the page&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>