How to Make a Comments Box in HTML

Published: | By POWR

Comment boxes are one of the best ways of fostering brand loyalty as they allow customers to leave comments, product ratings, and reviews on websites. The comments left on a website can also provide important demographic information about visitors which can be integrated into the marketing strategy of any business to improve critical performance ratings. 

A comment section can also help websites looking to build a community as it gives readers opportunities to interact, discuss, share experiences, and learn from each other. You can use a comment box app or one of several machine languages to integrate comment boxes into a website. If you go the latter route, HTML is one of the more efficient coding languages you can use. 

Methods for Creating an HTML Comment Box

To create a simple comment box on a website using HTML, use one of these methods:

Insert Codes

The first method for adding comment boxes in HTML is to use codes. However, there are many free scripts available on the web. With these scripts, you don’t need to worry about writing the code. You only need to copy and paste the code, and the comments section will display wherever you place the code. 

An example of codes from scripts is:

<!DOCTYPE html>



<h2>DelftStack learning</h2>

<h3>JavaScript comment box example</h3>

<form id="myForm">

Full name: <input id="userName" type="text" name="fname">


Email : <input id="userEmail" type="text" name="email">


<textarea id ="userComment" rows="4" cols="50" name="comment"> Enter comment here...</textarea>


<input type="button" onclick="myFunction()" value="Submit">


<h5>Submitted data :</h5>

<p id="data"></p>


function myFunction(){

let data = "";  let name = document.getElementById("userName").value

let email = document.getElementById("userEmail").value

let comment = document.getElementById("userComment").value


data = "User name : "+name+"<br/>User email : "+email+ "<br/>User comment : "+comment


document.getElementById("data").innerHTML = data  // display data to paragraph





The above script comes with a description, ‘Full Name’ (a box to be filled), ‘Email’ (a box to be filled), a comment box, and a clickable ‘Submit’ button. You can either copy and paste or type the codes into your favorite editor. When you are done, save the file with an HTML extension. 

To add the code to your website, log in and navigate to the page you want to add the comment section. Click ‘Page’ > ‘Edit,’ and then from the ‘Format Text’ tab, click ‘Edit Source.’ Copy and paste the codes from above and save. The page will reload with the comment section. Alternatively, you can import the HTML extension if the option is available on your website.

While downloading free scripts, note that some of them may come with extra options, including an edit and/or review button. Other scripts may insert the comment section with only a single clickable button for visitors to submit their comments. However, when using free scripts, ensure they are from verified, safe sources to protect your website from being compromised.

Use Tools

If you find adding and editing codes daunting, there are several great tools you can use to add a comment box to your website automatically. These tools, such as POWR, provide you with friendly user interfaces and automatically write codes on the backend as you make adjustments.

Using POWR allows you to seamlessly build professional comment boxes without working with codes. Not only can you build comment boxes easily, but POWR comes with advanced customization features for better management of your comment boxes. 

Unlike most other tools, you can manually set your display options for comments, receive emails for new comments, and retrieve important data from the comments. The POWR tool also works well with Shopify, Squarespace, Wix, WordPress, Jimdo, Bigcommerce, Weebly, and many other applications and platforms.


If your website was created with builders such as WordPress, Weebly, or GoDaddy, it automatically comes with comment section options. However, if your website builder does not have this functionality, you can leverage plugins to enable comment sections across your website. 

These plugins allow users with admin access to a website to define how the comment section should be moderated, whether or not the user must be signed in before commenting, and other conditions. If you don’t want a comment box on select WordPress pages, be sure to read our post on how to remove the comment box in WordPress.

In Conclusion

A comment box is a real-time functionality that often translates to a more interactive and engaging user experience on websites. There are several ways to add comment sections to your website, including using HTML scripts. Free scripts found on the internet can be used on select web pages, but they give you limited control over your users' comments. On the other hand, comment tools such as POWR combine the advantages of using codes with numerous customization options, making it the best choice.

Share this Article: