In this section, we will see how to use href attribute in anchor tag.
In this section, we will see how to use href attribute in anchor tag.In this tutorial, we will see the use of href attribute of anchor tag . The
href attribute of anchor tag holds URL of destination document, which we want
to visit. URL is a address of required file or document.
If href attribute is not available in anchor tag, it works as
a placeholder of hyperlink.
Attribute | Value | Description |
---|---|---|
href | URL (Address of destination document) |
Define the address of required file. Absolute Address(URL)-: another site. Relative Address(URL)-: within site. |
Declaration syntax of href attribute in anchor tag.
<a href="url">Text Area</a> |
hrefAttributeTag.html
<!DOCTYPE html>
|
Note: See the browser compatible page for successfully rendering the program.