How to open pdf file to another tab in browser

Last updated 2 years, 5 months ago | 897 views 75     5

Tags:- HTML

HTML | Target attribute

To open a pdf file we can use the target attribute of the anchor tag. The target attribute of the anchor tag specifies where to open the linked document.

Syntex for using an anchor tag with target attribute is:

<a href="url" target="target_value">Link text</a>

Let's try an example which will open the linked document in a new browser window:

<title>anchore tag with target blank</title>
<a href="" target="_blank">Visit!</a>