Articles → HTML → Anchor Tag In HTML
Anchor Tag In HTML
Syntax
<a href=”page_name”>text</a>
Sample
<html>
<head>
<title>Anchor Demo</title>
</head>
<body> <a href="page1.html">Click here to go to page1</a> </body>
</html>
Try It
Output
Target Attribute In The Anchor Tag
Target | Purpose | Demo |
---|
_blank | Opens the linked document in a new window | Try It |
_self | Opens the linked document in the same window | Try It |
_parent | Opens the link in the parent window | Try It |
_top | Opens the link in the full body of the window | Try It |
framename | Open the target document in the specified frame | Try It |
Browser Support
Internet Explorer | Firefox | Chrome | Safari | Opera | Edge |
---|
Yes | Yes | Yes | Yes | Yes | Yes |