Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I control all the link tags in html from one location?

Tags:

html

I am modifying my code for my website. I want all the links to open in a new window. However, instead of adding:

target="_blank"

for all the links, I was wondering if I could somehow control all link tags from one location.

like image 407
Wasiur Rahman Avatar asked Feb 17 '23 13:02

Wasiur Rahman


1 Answers

You can try adding a base tag to the head of the html

<base target="_blank">

http://jsbin.com/ezeyij/1/edit

Note: This also affects the target of forms as well.

like image 128
Musa Avatar answered Feb 19 '23 02:02

Musa