How to add target='blank' to <a> href attribute in JavaScript

2 Answers

0 votes
document.write('<a href="' + 'http://www.collectivesolver.com/' + '" target="_blank">' + 
                                                                  'collectivesolver' + '</a>');

 



answered Jun 26, 2017 by avibootz
0 votes
set_href('http://www.collectivesolver.com', 'collectivesolver');
                                                                  

function set_href(url, description)
{
    document.write('<a href="' + url + '" target="_blank">' + description + '</a>');
}

 



answered Jun 26, 2017 by avibootz
...