How To Use The HTML Tag

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more

Sharing is caring!

Element of
Building HTML Forms Is Easy: Tutorial With Copy-And-Paste Code
What does How To Use The HTML Tag do?
The <button> element is used to create an HTML button. Any text appearing between the opening and closing tags will appear as text on the button. No action takes place by default when a button is clicked. Actions must be added to buttons using JavaScript or by associating the button with a form.
Display
inline

Code Example

<button type="button" onclick="alert('You pressed the button!')">Click me!</button>
Adam is a technical writer who specializes in developer documentation and tutorials.

Browser Support for button

AllAllAllAllAllAll