Passing a anchor id to open accordion
I am reasonably new to Jquery and I am having trouble working out this problem and was hoping someone could help.
I have created a simple accordion that hides and shows span tags when the corresponding h3 header is clicked.
The Jquery:
$(".accordion span").addClass("answer");
$(".answer").hide();
$(".accordion h3").click(
function() {
$(this).next(".answer").toggle().siblings(".answer:visible").hide();
}
I would like to pass a anchor id via the url so that I can open the correct span via an external link.
I have added id,s to each h3 and named the href:
<h3 id="#send"><a href="#send">Sending an Email</a></h3>
I have also added the anchor to the actual link
<p><a href="/bucs/email/testOpenAcord.html#send" target="_self" id="send">Link to open accordion</a></p>
However, I cannot work out how to test for the anchor and open the associated span tag - any help I could get with this would be fantastic.