Recreate onClick function

Recreate onClick function

Hi all,

I have some jquery code which is performed when clicking a tab.

  1. $('.content-box ul.content-box-tabs li a').click( // When a tab is clicked...
                function() {
                    $(this).parent().siblings().find("a").removeClass('current'); // Remove "current" class from all tabs
                    $(this).addClass('current'); // Add class "current" to clicked tab
                    var currentTab = $(this).attr('href'); // Set variable "currentTab" to the value of href of clicked tab
                    $(currentTab).siblings().hide(); // Hide all content divs
                    $(currentTab).show(); // Show the content div with the id equal to the id of clicked tab
                    return false;
                }
            );









In my save routine I am saving form details from the selected tab and returning back to the page, however this is defaulting back to tab1.

Is it possible for me to re-create this onclick function for when the page loads. This way i can pass in my url  (www.test.com/admin/#tab4) and it will pick up the #tab4 section and display that tab?

Thanks for help with this!