Jump to content

Link to html accordion panel


Recommended Posts

You use the url to that accordion effect with the bookmark hash

< a href="theurloftheepageyouwanttogoto.html#firstlocation">click here to see the first location</a


paste above code in place of what's here


Now in the address bar add #bookmarkword to the end of url and press enter. This will represent the url with hash link from another page.

Hit run

Change hash to #bookmarkpara

Hit run.

it identifies where the bookmark is! transverses up the parent element containers <p>...</p>, <section>...</section>, <article>...</article> till it reaches a div element, set in the while loop condition. It takes the div elements id and runs the myFunction() using that id as a paremeter.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...