12.HTML Anchor Tag
12.HTML Anchor Tag
HTML Anchor
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.
1. <a href="second.html">Click for Second Page</a>
Example:
1. <!DOCTYPE html>
2. <html>
3. <head>
4. <title></title>
5. </head>
6. <body>
7. <p>Click on <a href="https://www.javatpoint.com/" target="_blank"> this-
link </a>to go on home page of JavaTpoint.</p>
8. </body>
9. </html>
Output:
1/2
Note:
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.
Supporting Browsers
2/2