Anchor tag in html
The <a> tag defines a hyperlink, which is used to link from one page to another.
The most important attribute of the <a> element is the href attribute, which indicates the link's destination.
By default, links will appear as follows in all browsers:
- An unvisited link is underlined and blue
- A visited link is underlined and purple
- An active link is underlined and red
<!DOCTYPE html>
<html>
<body>
<a href="https://technisias.blogspot.com/">technisia!</a>
</body>
</html>
Output:
phone number as a link:
<!DOCTYPE html>
<html>
<body>
<p>
This is a phone link:
<a href="tel:+4733378901">+47 333 78 901</a>
</p>
</body>
</html>
Output:
This is a phone link: +47 333 78 901
linking java script with anchor tag:
<!DOCTYPE html>
<html>
<body>
<a href="javascript:alert('Hello World!');">Execute JavaScript</a>
</body>
</html>
Output:
Comments
Post a Comment