I have a comment tree similar to Reddit’s. People will need to be able to reply the comments by clicking a reply link, and then a form with a textarea should come. I tried using the .show() method, but there is more than one comment, and when you click reply it shows all the forms for every comment. How can i fix this? What should i look into?
I have a comment tree similar to Reddit’s. People will need to be able
Share
You’ll need to set a class for each
textarea(A different class for each one).Let’s say:
<textarea class="commentAnswerBox1">Answer here...</textarea>Now you have to set up a class for each comment answer button
Like this
<input type="button" class="btnAnswer1" value="Answer this comment" />Now you can call a function that recognizes which
btnAnswerwas clicked, and show only the correspondentcommentBox.You can use Class or IDs, or also create an attribute, it doesn’t matter.