I have a HTML structure like follows
<div id="answer-1">
<a class="edit"></a>
</div>
<div id="answer-2">
<a class="edit"></a>
</div>
<div id="answer-3">
<a class="edit"></a>
</div>
<div id="editor" style="display:none;">
</div>
What i wanna do is when user clicks on the link with a class of edit i will have to hide it's parent div and all subsequent divs having ID like answer-x and have to show the div with the id of editor. I need help with this. This is not not the exact html structure. And the anchor tag with a class of edit may or may not be the immediate child of the div with ID answer-x.It can be in one or two more levels deep inside like
<div id="answer-x">
<div id="hor-list">
<a class="edit"></a>
</div>
</div>
So if users clicks on the anchor link inside answer-2 i have to first hide answer-2 and then all answer-x div afterwards.So for the above structure it will be hiding answer-2 and answer-3 div and then showing editor div.