How can I set/store cookie when anchor clicked
<p>I am trying to use Cookie so that a default style OR a specific style is applied in reference to the anchor tag clicked, even when the browser is closed/reopen.
So if the user clicked the second link, close or refresh the browser and reopen, than the style should still be active, if it is their first time the default should apply.
This is a little over my turf. </p>

<p><strong>Here is the HTML:</strong></p>

<pre><code>&lt;a id="default" href="#/"&gt;Default Style&lt;/a&gt;
&lt;a id="style2"  href="#/"&gt;Style 2&lt;/a&gt;
&lt;a id="style3"  href="#/"&gt;Style 3&lt;/a&gt;

&lt;ol&gt;
&lt;li&gt;&lt;span&gt;Hello World&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
</code></pre>

<p><strong>JQuery: (Compliments of StackOverflow)</strong></p>

<pre><code>&lt;script type="text/javascript"&gt;
$('#default').on('click',function(){
    $('ol li span').removeClass(function() {
          return $(this).attr('class');
        }).addClass('default');
});
$('#style2').click(function(){
    $('ol li span').removeClass(function() {
          return $(this).attr('class');
        }).addClass('style2');
});
$('#style3').click(function(){
    $('ol li span').removeClass(function() {
          return $(this).attr('class');
        }).addClass('style3');
});
&lt;/script&gt;
</code></pre>

<p><strong>CSS:</strong></p>

<pre><code>&lt;style type="text/css"&gt;
.default{
color: #333;
}

.style2{
color: #999;
}

.style3{
color: #800;
}
&lt;/style&gt;
</code></pre>
