Hello everyone!
I have this piece of JQuery:
Code:<script type="text/javascript"> $(document).ready(function() { $('#tab1').on('click',function(){ $('ol li span').removeClass(function() { return $(this).attr('class'); }).addClass('default'); }); $('#tab2').click(function(){ $('ol li span').removeClass(function() { return $(this).attr('class'); }).addClass('style2'); }); $('#tab3').click(function(){ $('ol li span').removeClass(function() { return $(this).attr('class'); }).addClass('style3'); }); }); </script>
HTML:
As you can see I simply need to apply a particular style to list in a span when a tab with the specific ID is clicked, the issue is Cookies which I do not eat often.HTML Code:<a id="tab1" href="#">Sample</a> <a id="tab2" href="#">Sample</a> <a id="tab3" href="#">Sample</a>
How do I make this stay? If the user selects/clicks a particular tab I would rather the style remain on refresh or browser close and if nothing is selected when the page is first visited than the default applies.
By the way I am using ID on the link (anchor) because it is doing something unrelated to this post.
I can find my way around applying a single style (default) but in this case there are different styles for each tab clicked.
This I do not know.
Thanks for reading my sob story.
IC



Reply With Quote



Bookmarks