Skip to content Skip to sidebar Skip to footer

How To Make Accordion Sections Both Selectors And Hyperlinks?

I want to make so that accordion titles work both as selectors and as hyperlinks. How is it possible? For example, is is possible to make one part of title to work as section opene

Solution 1:

If your using html 5 it is now valid to wrap whole section in anchor tags so you could in theory do something like

<divid="accordion"><ahref="#"><h3>First header</h3><ahref="/myhtml1.html">Header link</a></a><div>First content</div><ahref="#"><h3>Second header</h3><ahref="/myhtml2.html">Header link</a></a><div>Second content</div></div>

Then you just have to style your h3 and header link tags with floats etc... Hope that helps.

You can also create a jsFiddle and I can get it working if you like

Post a Comment for "How To Make Accordion Sections Both Selectors And Hyperlinks?"