Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

looking for # on a url

I have a some tab panels on my html page, and each tab has an href telling the tab like this:

<li class="list"><a href="#tab6">FAQs / Ajuda</a></li>

but I would like to open that #tab6 from another page and make my active tab onload.

Can someone give me a little piece of jquery sample to accomplish this this?

I thought about the href from the another page call something like: http://somelink.com/help.html#tab6

like image 416
Killercode Avatar asked Feb 25 '23 03:02

Killercode


1 Answers

It is the url hash. You can get the value like, no jQuery needed:

var hash = window.location.hash;
like image 105
Dustin Laine Avatar answered Feb 26 '23 21:02

Dustin Laine