# Loading a JS Variable into HTML page

**URL:** <https://forum.kirupa.com/t/loading-a-js-variable-into-html-page/321986>\
**Category:** web dev\
**Created:** [May 6, 2011, 2:15pm UTC](https://forum.kirupa.com/t/loading-a-js-variable-into-html-page/321986 "2011-05-06T14:15:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [May 6, 2011, 2:15pm UTC](https://forum.kirupa.com/t/loading-a-js-variable-into-html-page/321986/1 "2011-05-06T14:15:16Z")

</div>

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…

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

```

but it doesnt read … any tips?
