Links are basically small web components/elements and they help a user to navigate from one part of a web page to another or to an external website. These links also play a very crucial role in the world of Search Engines and SEO.
There are multiple methods to create a link.
- Using the <a> tag
Normal <a> Tag
It’s quite simple to create a HTML link. The code for the same will be:
<a href="http://www.tech-faq.com" target="_blank">Tech FAQ</a>
This is how the above mentioned code will function: Tech FAQ
To create a link using the window.open method, the code will be:
The above mentioned code will work like this: Tech FAQ
click() of JQuery
If you are using JQuery in your development, you can use the click() function to generate a click event on any HTML element.