 <p>You should pass strings enclosed in quotes - otherwise JavaScript thinks they're variable names:</p> <pre><code>&lt;p&gt;&lt;input type="radio" name="look" onClick="setActiveStyleSheet('main')" checked&gt; Light &amp; dark blue&lt;/p&gt; &lt;p&gt;&lt;input type="radio" name="look" onClick="setActiveStyleSheet('alt1')"&gt; Black &amp; white&lt;/p&gt; &lt;p&gt;&lt;input type="radio" name="look" onClick="setActiveStyleSheet('alt2')"&gt;Yellow &amp; red&lt;/p&gt; </code></pre> <p>But your real problem is this: </p> <pre><code>a = document.getElementsByTagName("link") </code></pre> <p>sets <code>a</code> as an HTMLCollection object, not as the link itself. Change it to:</p> <pre><code>a = document.getElementsByTagName("link")[i] </code></pre> <p>And you'll be fine. </p> <p>It seems alistapart isn't perfect after all.</p>