HTML attributes provide additional information about HTML elements and are used to modify the behavior or appearance of elements. They are always included in the opening tag and usually come in name/value pairs like this: name="value".
Common HTML Attribute
HTML id Attribute
HTML class Attribute
HTML src Attribute
HTML href Attribute
HTML title Attribute
HTML target Attribute
HTML style Attribute
HTML alt Attribute
HTML width and height Attribute
HTML value Attribute
HTML disabled Attribute
HTML lang attribute
The id Attribute
The id attribute isUniquely identifies an element.
Example
<div id="header">Header Content</div>
The class Attribute
The class attribute is Defines one or more class names for an element, which can be used by CSS or JavaScript.
Example
<p class="text-bold">Bold Text</p>
The src Attribute
The src attribute is Specifies the source of an image, script, or other external content.
The value attribute is specifies the initial value for an input element.
Example
<input type="text" value="Enter your name">
The disable Attribute
The disable attribute is disables an input element, making it unclickable or uneditable.
Example
<button disabled>Can't Click Me</button>
The lang Attribute
The lang attribute in HTML specifies the language of the element's content. It helps search engines and browsers understand the language used in the document
We use cookies and similar technologies to enhance your browsing experience, serve personalized content and advertisements, and analyze our traffic.
By clicking "Accept All", you consent to our use of cookies and the processing of your personal data for these purposes.
You can manage your preferences or learn more in our
Privacy Policy and
Cookie Policy.