A
A
Andrey Borchik2018-03-31 12:06:11
css
Andrey Borchik, 2018-03-31 12:06:11

How to automatically add target="_blank" to all links on the site?

Website arthata.by
I want to test a hypothesis and add target="_blank" to all links.
How can I do it automatically using a script?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sklyarov, 2018-03-31
@0example

$(document).ready(function(){
  $('a').attr('target', '_blank');
});

But this is a crutch option, as for me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question