How should I code a javascript function so I can call it from a link?
<p>I am trying to create a style switcher. What I would like to do is to have some boxes on my page for each color. Something like the following:</p>

<pre><code>&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#" Title="Style A" onclick="javascript:changeStyle("/Content/Themes-jQuery/humanity/jquery-ui-1.8.17.custom.css")&gt;A&lt;/td&gt;
&lt;td&gt;&lt;a href="#" Title="Style B" onclick="javascript:changeStyle("/Content/Themes-jQuery/vader/jquery-ui-1.8.17.custom.css")&gt;B&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Then within the function I would like to do this:</p>

<pre><code>$("link[title='jquery-ui-theme']").attr("href", xxx  );
</code></pre>

<p>Where xxx is the argument passed to the function. </p>

<p>Can someone give me some advice on how I can call the function from inside the <code>&lt;a&gt;</code> link and what the definition of the function would need to look like. </p>

<p>Also is there a better way that I could do this using more jQuery? Would it be better to use DIVs instead of table/rows?</p>
