So i have a unordered list, each item in the list has a button that is suppose to toggle the post comment textarea. Unfortunately with my first attempt when u click on one Post Comment button all textareas open, then i tried to use this to make sure only one element is selected. Here is the code:
<ul class="todosDisplay">
<li><span>Content of todo</span><a class="postComment">Post Comment</a>
<textarea class="showMe"></textarea>
</li>
<li><span>Content of todo</span><a class="postComment">Post Comment</a>
<textarea class="showMe"></textarea>
</li>
<li><span>Content of todo</span><a class="postComment">Post Comment</a>
<textarea class="showMe"></textarea>
</li>
</ul>
And here is my jquery code
$(".postComment").click(function () {
$(this).parent().find(".showMe").toggle();
});
As you can see my poor man's attempt to get to the parent of the ACTUAL element, and then find the element we need to toggle does not work :)
Thanks a lot in advance!