html – How do I change the text content of a div for a comment validation error message?

Question

My comment form has validation so that when a user tries to post a blank comment, it currently shows the “This field is required” message under the comment box. How do I change the message content to “Please enter your comment.”? I’m guessing that the following line of code might do the trick but I don’t know how to nest HTML code in my functions.php file.

document.getElementById("comment-error").innerHTML = "Please enter your comment.";

Any help would be most appreciated.

0
Scarlett 5 months 2021-07-06T19:10:05-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse