Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

web
html button
button html
button
html

How to insert a button in HTML

Educative Answers Team

The <button> tag in HTML defines a clickable button.

Syntax

The general syntax is:

<button>Button Name</button>
svg viewer

Inside a <button> element you can put the following content:

Adding Text

You can add text to the HTML Button.

For example, to create a submit button you can write:

<button type="button">Submit</button>

Adding Image

You can put an image in HTML Button.

For example, to create a image button write:

<button><img src="image url"></button>

HTML Attributes

HTML button have various attributes.

Syntax

The general syntax for adding attributes to the html button is:


<button type="button" attribute-name>Button Name</button>

Disabled

The disabled attribute makes the button unusable and unclickable.

Autofocus

The autofocus attribute specifies that the button should automatically get focus when the page loads.

RELATED TAGS

web
html button
button html
button
html
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring