The point of the question is that after loading the page you need to check its url and if the URL, for example, looks like this:
http://example.com/index.html#sometab then make an active tab with id="sometab" . And if the url does not contain any "anchors", then do nothing.