I'm trying to move my Reply Form from one comment block to another according to where Reply button was pushed.
For example I have this code.
<ul class="comments-list">
<li class="comment" id="'.$comComment->CommentID.'">
<div>Comment Content</div>
<a class="comment-reply-link"></a>
<ul>
<li>
<div>Comment Content</div>
<a class="comment-reply-link"></a>
</li>
</ul>
</li>
<li>
<div>Comment Content</div>
<a class="comment-reply-link"></a>
</li>
</ul>
And then reply form:
<div id="comment-reply">And Form HEre</div>
I know how to do it with display block and none but I'd like to avoid making Reply form in every comment block and hiding it.
Is it possible to do it with something like parentNode.insertBefore
and parentNode.removeChild.
or is there a better way to do that.
Would appreciate any help or related links.
Thank you.