How to create a name in a link?

Brajagopal Tripathi
2 min readSep 6, 2023

--

Photo by Jackson Sophat on Unsplash

To create a name in a link, you can use the href attribute. The href attribute specifies the URL of the link. You can also use the name attribute to specify the name of the link. The name attribute is optional, but it can be useful for creating named anchors.

Here is an example of how to create a name in a link:

HTML

<a href="https://www.google.com/" name="google">Google</a>

In this example, the link has the name “Google”. When you click on the link, it will take you to the Google website.

You can also use the name attribute to create named anchors. A named anchor is a specific location within a web page. You can use named anchors to create links that jump to specific parts of a web page.

Here is an example of how to create a named anchor:

HTML

<a name="top"></a>

This code creates a named anchor called “top”. You can then create a link to this named anchor using the href attribute.

Here is an example of how to create a link to a named anchor:

HTML

<a href="#top">Go to the top of the page</a>

In this example, the link will jump to the named anchor called “top”.

I hope this helps!

--

--

Brajagopal Tripathi

Student of Computer Application and Network Administration || Cloud Technology and Cyber Security Enthusiast