How do I write my script for each link I want to redirect
<p>So I'm trying to redirect users from html links and element id tags, to other pages with javascript. I've figured out how to do one singular redirect but having trouble writing the code for multiple links heres what I have so far:</p>

<p>HTML:
    
    </p>

<pre><code>&lt;head&gt;
&lt;script type = "text/javascript" src="script2.js"&gt;&lt;/script&gt;
&lt;/head&gt; 

&lt;body&gt;
&lt;a href="nickname.html" id="redirect1"&gt;NickName&lt;/a&gt;
&lt;a href="salestax.html" id="redirect"&gt;Salestax&lt;/a&gt;
&lt;a href="http://www.w3schools.com" id="redirect2"&gt;W 3 Schools&lt;/a&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>My external script so far for just one link:</p>

<pre><code>window.onload = initAll;

function initAll() {
     document.getElementById("redirect").onclick = initRedirect;
}

function initRedirect() {
  confirm("Go to Salestax page?");
  window.location="salestax.html";
  return false;
 {
</code></pre>

<p>Do I just crank out more functions and change the location value, getElementById value and the onclick value?</p>
