HTML open link in new tab
Links are found in almost all pages. Links permit clients to click their way from one page to another. Tab serves important while linking the page. Tabs are ideal for single page web applications, or for website pages equipped for showing different sections. In this post, let's learn how to write HTML code to open the link in a new tab.
Built Hyperlink with Anchor Tag
HTML anchor tag <a> is made for linking resources. The text within anchor opening and closing tags is displayed on the web page as link. The anchor tag has href attribute that contains the location of the web page. The anchor tag consists three parts - href attribute, name attribute and target attribute. The target attribute is responsible to open link in new tab.
The target attribute specifies where to open the linked document. Like, there may be need to open the document in the new tab, in a new window, in the same frame, in the parent frame. The 'target= "_ blank "' is used for opening of the target page in a new tab. This is the usual option when using target attributes for linking to other pages.
<a href="http://www.etutorialspoint.com" target="_blank">etutorialspoint</a>
When someone clicks on the connection, it will open up in another tab, or conceivably another window relying upon the individual's browser settings.
Secure new tab
It is important to secure the pages you link to from tabnapping. The tabnapping can result a page that you link to redirect to a fake login page. The rel attribute sets the relation between your page and linked URL. The rel attribute set to noreferrer noopener to prevent a type of phishing known as tabnabbing from the pages you link to -
<a href="http://www.etutorialspoint.com" target="_blank" rel="noopener">etutorialspoint</a>
How to display PDF file in PHP from database
How to read CSV file in PHP and store in MySQL
Create And Download Word Document in PHP
PHP SplFileObject Standard Library
Simple File Upload Script in PHP
Sending form data to an email using PHP
Recover forgot password using PHP and MySQL
Php file based authentication
Simple PHP File Cache
How to get current directory, filename and code line number in PHP