9.2. <a> Tag for Links
To create a link inside a heading, you can use the <a> tag. This is useful for headings that take users to other pages or to other sections of your website.
link href is an attribute of the <a> tag (anchor tag) that is used to set the address (URL) that points to:
- Another website
- Another page on the same website
- A file (PDF, image, document…)
- An email address or phone number
Syntax:
· <a> : the tag for creating a link· href : sets where the link goes
· URL : the destination address
· Link text : what the user clicks
Source Code:
<!DOCTYPE html>
<html>
<head>
<title>Link in Heading Example</title>
</head>
<body>
<h1>Example of Link</h1>
<h2>
<a href="https://softkhpc.blogspot.com/" target="_new">
Click for Visit our website
</a>
</h2>
</body>
</html>Result:
- target="_blank" Attribute
- Opens the link in a new tab or window
- Every click → always opens a new tab/window
- target="_new" Attribute
- Opens the link in a window/tab named "_new"
- If "_new" doesn't exist yet → creates a new one
- If "_new" already exists → reuses that same window/tab
Watch the video:


