All HTML elements can have attributes.
Attributes provide additional information about an element.
They are always specified in the start tag and usually come in name/value pairs.
<tagname attribute_name="value">Content</tagname>
<a href="https://www.example.com">Visit Example</a>
| Attribute | Purpose | Example |
|---|---|---|
| href | Specifies the URL for a link | <a href="https://example.com"> |
| src | Specifies the path of an image | <img src="image.jpg"> |
| alt | Provides alternate text for an image | <img alt="My Image"> |
href attribute.href attribute.href="https://aitaurangabad.com" inside the opening <a> tag.<html> <body> <h2>Academy Website Link</h2> <p>You can visit the official website of the Academy of Information Technology (AIT) by clicking the link below:</p> <a href="https://aitaurangabad.com">Academy of Information Technology (AIT)</a> </body> </html>
You can visit the official website of the Academy of Information Technology (AIT) by clicking the link below:
Academy of Information Technology (AIT)href attribute provides additional information inside the start tag to specify the destination URL for a hyperlink.