Jerome Ansia Jerome Ansia - 2 years ago 153
jQuery Question

jQuery UI tabs, update url when clicking on a different tab

I'm using the tabs of jQuery UI:

How to update the current url of the browser when the user click on a different tab by adding the anchor link to it:
ex: url.html#tab-4 and pushing the current history of the browser at the same time.

Thank you!

Answer Source

This should get what you want. I used the sample html in jquery ui demos

        $( "#tabs" ).tabs({
            select: function(event, ui) {                   
                window.location.hash =;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download