title: Simple onclick page loader
body: <p>I made this really basic startup page in HTML that has images that reference websites. Is there a way to add a loader after the user clicks on the image then the loader goes away when the website comes up? I am trying to give users something to look at while a website loads. Below is a sample href line that I use.</p>
  
  <pre><code>&lt;a href="https://Website.com"&gt;&lt;img border="0" alt="Image" src="logo.gif"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I found this onclick script online but I do not know how to add it to my startup page. Can anyone help me put these together? Where should I place the line 'onclick="myFunction()?"'Thank you!</p>
  
  <pre><code> onclick="myFunction()"
  
   &lt;script&gt;
   var myVar;
  
   function myFunction() {
   myVar = setTimeout(showPage, 3000);
   }
  
   function showPage() {
   document.getElementById("loader").style.display = "none";
   document.getElementById("myDiv").style.display = "block";
   }
   &lt;/script&gt;
  </code></pre>