JavaScript doesn't have a data binding facility so refering to
isn't going to replace the linkTo part with the linkTo variable.
You can bind yourself, easier if you give the a element an id such as 'myLink':
Code:
var link = document.getElementById("myLink");
link.href = linkTo;
and call this code in the document's onload handler.
If you find yourself writing a lot of this sort of code you may want to start using jQuery templates or the knockout.
js library.