Answer the question
In order to leave comments, you need to log in
What is the best way to implement the ability to show and hide the "reply" form in the comments?
There is a "reply" button in the comment form, which, when clicked, should toggle the "d-none" bootstrap class on or off.
Each "reply" button has an onClick and id binding (for example, #reply-on-comment-5), as well as the response forms themselves with an id (#form-to-reply-on-7)
How can I better implement receiving id of the comment that should be answered if I use the following function:
function myFunc() {
var para = document.getElementById("form-to-reply-on-COMMENT_ID");
para.classList.toggle("d-none");
}
Answer the question
In order to leave comments, you need to log in
It is possible without js at all: https://jsfiddle.net/dofzgt9v/1/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question