Href attribute of HTML anchor tag
The href attribute is used to define the address of the file to be linked. In other words, it points out the destination page.
The HTML anchor tag defines a hyperlink that links one page to another page.
It can create hyperlink to other web page as well as files, location, or any URL.
The "href" attribute is the most important attribute of the HTML a tag. and which links to destination page or URL.
The href attribute is used to define the address of the file to be linked. In other words, it points out the destination page.
<a href = "navigate link goes here"> Link Text </a>
If we want to open that link to another page then we can use target attribute of tag. With the help of this link will be open in next page.
The target attribute can only use with href attribute in anchor tag.
If we will not use target attribute then link will open in same page.
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <p> Click on <a href="https://www.example.com/" target="_blank"> Click on Me! </a> to go on home page of Example. </p> </body> </html>
Click on Me! to go on home page of Example.