Glad I could help a bit, but I am a little confused by your response.
What action? Have I missed something?
This shouldn't happen. Using the code I supplied, if I click on the link "Tab2", then the span tag gets a class of "style2" applied to it.
If I refresh the browser then the span tag still has a class of "style2". If I shut the browser and open it again, the span tag still has a class of "style2".
This is what you wanted, right?
If this is different for you, then maybe it has something to do with browser compatibility or jQuery version? I'm using the latest version of Chrome in Win7 and the latest jQuery. What about you?
When I do everything described above, then click on the link "Tab1", the span gets a class of "default". This also survives a page refresh or shutting the browser.
Weird if this isn't working for you.
If I have misunderstood any of your requirements or if I can help you debug this further, then just let me know.