Reputation: 1495
Im sure a very schoolboy question.
I'm using the tabs example from here http://www.w3schools.com/howto/howto_js_tabs.asp
And would be interested to know how to link from a external page to a specific open tab ie:Tokyo tab. It looks like there are ids on the tabs but don't seem to display them in the url bar.
Upvotes: 0
Views: 62
Reputation: 31
You need to parse the url of the page using JavaScript and show tab depending on the necessary hash
Upvotes: 1
Reputation: 1932
The external link can be simply added in the new a href
parameter of the tab. The code would look something like this:
<li><a href="#" class="tablinks"><a href="linkToTokyoCity">Tokyo</a></a></li>
Upvotes: 0