Add CSS class to selected link

Add CSS class to selected link

Hey all!

I'm building a calendar and using a jQuery script to shift between "list view" and "calendar view". The thing is, that I would like to add a unique CSS class to the selected link, so I can make a highlight effect (or something like that) that only applies to the currently selected link. My script is:
  1. jQuery(document).ready(function(){
  2.   //if this is not the first tab, hide it
  3.   jQuery(".tab:not(:first)").hide();
  4.  
  5.   //to fix u know who
  6.   jQuery(".tab:first").show();
  7.  
  8.   //when we click one of the tabs
  9.   jQuery(".htabs a").click(function(){
  10.   //get the ID of the element we need to show
  11.   stringref = jQuery(this).attr("href").split('#')[1];
  12.   //hide the tabs that doesn't match the ID
  13.   jQuery('.tab:not(#'+stringref+')').hide();
  14.   //fix
  15.   if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") {
  16.   jQuery('.tab#' + stringref).show();
  17.   }
  18.   else
  19.   //display our tab fading it in
  20.   jQuery('.tab#' + stringref).show();
  21.   //stay with me
  22.   return false;
  23.   });
  24.  
  25. });
As I'm completely new to jQuery and didn't even write this script myself, I don't know how to do this. I've tried adding:
  1. jQuery(this).addClass('active');
But it didn't work out that well...