JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" class="replyshow">Reply (hide)</a>
<textarea class="reply"></textarea>
<a href="#" class="replyshow">Reply (hide)</a>
<textarea class="reply"></textarea>
<a href="#" class="replyshow">Reply (hide)</a>
<textarea class="reply"></textarea>
<a href="#" class="replyshow">Reply (hide)</a>
<textarea class="reply"></textarea>
<a href="#" class="replyshow">Reply (hide)</a>
<textarea class="reply"></textarea>
JavaScript
$(document).ready(function() {
$(".replyshow").click(function() {
var $this = $(this);
$this.text(function(i, text) {
return text === "Reply (hide)" ? "Reply (show)" : "Reply (hide)";
});
$this.next('.reply').toggle(($this.text() == "Reply (hide)"));
});
});