Changing Style Sheet javascript
<p>I got this HTML code:</p>

<pre><code>&lt;head&gt;
&lt;script type="application/javascript" src="javascript.js"&gt;
&lt;link id="pagestyle" href="default.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;
 &lt;body&gt;

&lt;button id="stylesheet1" &gt; Default Style Sheet &lt;/button&gt;
&lt;button id="stylesheet2" &gt; Dark Style Sheet &lt;/button&gt;

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

<p>And in javascript.js I got this:</p>

<pre><code>function swapStyleSheet(sheet) {
document.getElementById("pagestyle").setAttribute("href", sheet);  
}

function initate()
{
var style1 = document.getElementById("stylesheet1");
var style2 = document.getElementById("stylesheet2");

style1.onclick = swapStyleSheet("default".css);
style2.onclick = swapStyleSheet("dark".css);        
}

window.onload = initate;
</code></pre>

<p>I want to the style sheets to change while pressing this buttons. I can't figure out why it is not working. </p>
