javascript - Anyway to force / override html and get a link to open in a new tab/window? -


not sure if there way, possible force links open in new tab / window if html not include it? possibly not, thought ask!

i importing data site.

the problem data contains many links more information - not problem , happy people click on links.

my issue if do, gone site.

therefore great if ensure stay on site , open new tab or window more info.

i struggling add code, have included below snippet

<div id="lrep799873847" style="width: 350px;">data loading....<a href="http://full-time.thefa.com/index.do?divisionseason=664547402">click here premier division</a><br/><br/><a href="http://www.thefa.com/full-time">full-time home</a></div>  <script language="javascript" type="text/javascript">  var lrcode = '799873847'  </script>  <script language="javascript" type="text/javascript" src="http://full-time.thefa.com/client/api/cs1.js"></script>

if html doesn't include can using jquery as:

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

target="_blank" force open in new tab


Comments