How to use link() to create a string representing the code for an <a> HTML element in JavaScript

1 Answer

0 votes
var txt = 'CS';
var URL = 'http://www.collectivesolver.com/';

document.write('Click on ' + txt.link(URL));


/*
run:

Click on <a href="http://www.collectivesolver.com/">CS</a>

*/

 



answered Aug 10, 2016 by avibootz
...