Loading a JS Variable into HTML page

Hi - I have a variable instance in Javascript in my <head>

I want to put this into an <ahref> tag … how do I access this?
at the moment I have been doing this…

<a href="myFile.php?"+myVar>my link</a>

but it doesnt read … any tips?