What Are HTML Attributes?

HTML Attribute Provides Additional Information.

Rajdeep Singh
Rajdeep Singh

1 min read

Table of contents

HTML tags can also have their Attributes, which are Contain Some Extra Information.

In most cases, attributes are defined in name="value" pairs, and they are always declared in the opening tag.

Note: Attribute And Data Attribute not be Some.

They look like:

<tag attribute="value" attribute1="value1">Content Here </tag>.
copy success

Example:

<p align="center">This is paragraph</p>

<b style="color: red" >Bold text</b>

<button onclick="changeColor()">Click </button>
copy success