I’m newbie in javascript and I want to render a form when user clicks a button, I tried different methods but I wasn’t successful. Here is the code:
<a href="" id="reply">Reply</a>
<form action="" method="post" >
<textarea name="comment" class="comment_textarea"></textarea>
<input type="hidden" name="id" value="5">
<input type="submit" class="btn" value="Reply">
</form>
I’m using this in threaded comments. I just want to render this form when user clicks reply button and otherwise this form should not be displayed.
As @des said, you could use
a#replyas a trigger. In jquery it only needs a couple of lines of code:Example