Your browser does not support JavaScript!
Upvotes Anonymous 0 User 0

How to create a button in HTML

There are two ways to create a button in HTML. One is with the <button> tag, and the other is with the <input> tag.

What's the difference? The <button> tag allows you to use HTML inside of your button (so you could bold certain letters on the button's text, etc).
The button tag
<button id="mybutton">Click me</button>

It looks like this:
The input tag
<input type="button" value="Click me too">

Here's what it looks like:
The input tag does not need a closing tag. See discussion here.
Was this helpful?

Tags

Comments

Leave a Comment

I agree to the Terms of Service
Design © 2015, Downranked, LLC.,
Original user code contributions under MIT License