Jquery not retaining class after post back
<p>I am displaying some content using XSL(XML) 1.0. I have acategory and a subcategory; when I hit link in category it adds a query parameter. I was trying to add/remove a class using jQuery on click of link . It gets changed but after page refresh it removes any changes.</p>

<pre><code>Category
---------
United States
Australia
India

SubCategory
--------------
United States
Texas
New York
Florida

Australia
Sydney
Melbourne
Brisbane

India

Delhi
Mumbai
Gujrat
</code></pre>

<p>So when I click United States, it adds <code>?Category=United States</code> and I want to display subcategory only for United States:</p>

<pre><code>$('.main-nav ul li').click(function(){
        $('.main-nav ul li').removeClass('current');

            $(this).addClass('current');
            var contentId = $(this).attr("id");
            alert(contentId);

                changeContent();
});

function changeContent(){   
            $('.sub-nav').removeClass('currentitem');
            //find which item is current
            var contentId = $('.main-nav ul li.current').attr("id");
            //display the related content
            $("div#" + contentId).addClass('currentitem');

    }
</code></pre>

<p>and I was hiding and showing content throw CSS. So it changes the class when I click but as the query-parameter refreshes the page , it removes everything.</p>
