![]() |
HTML (Hyper Text Markup Language) plays the most significant role in website development. But when it comes to good user experience and easy navigation then the <a> tag is used. In this article, we will discuss the hyperlink tag, its possible attributes, and how a user can open a web page in a new window in HTML. IntroductionThe target attribute in HTML states where to open the linked document. It is an attribute of the <a> (anchor) tag, which is used to define hyperlinks. The target attribute determines whether the link will open in the same window, a new window, or a specific frame. The <a> is a paired tag, so both starting <a> and closing tag </a> in HTML document Ancher has many attributes but href (hypertext reference) the mandatory as it specifies the destination URL of the webpage the link will move to. The target attributes are specifying that the multiple ways a user can open web pages. Syntax:<a href="URL" target="_top"> Linked Text </a> Types of Target AttributesThis attribute refers to the target window for the URL mentioned with href attribute. It can take the following possible values:
How to open webpage into a new window in HTML?If we want to load the web page content in a new tab/window, then we have to use <a> tag and inside <a> tag set the target attribute as “_blank” as like given in bellow example below. Then the web page will open in a new window on the user’s click. Example:The below example describes the use of target=”_blank”. When a user clicks on the linked text the webpage will open up in the new window.
Output: ![]() target_blank ConclusionBy using the target attribute “_blank” in HTML the developers can specify whether a link opens in a new window and it helps users navigate the website easily . |
Reffered: https://www.geeksforgeeks.org
HTML |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |