How to add a button in HTML?

To add a button in HTML, use the <button> element.


Type Attribute: The type attribute specifies the type of button
<button type=”submit”> Submit</button>

The `name` attribute specifies the name of the button, and the `value` attribute specifies the value sent to the server.
<button type=""submit"" name=""submit-btn"" value=""clicked"">Submit</button>

style buttons using CSS
<button style=""background-color: #4CAF50; color: white; padding: 10px 20px; border: none; cursor: pointer; border-radius: 5px;"">Click Me</button>

Go from files to website in seconds.

Start a free trial for 7 days — no credit card required

Get Started for Free