# Document.write inside an href

**URL:** https://forum.kirupa.com/t/document-write-inside-an-href/295531
**Category:** Uncategorized
**Created:** [September 1, 2009, 1:07am UTC](https://forum.kirupa.com/t/document-write-inside-an-href/295531 "2009-09-01T01:07:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)
#### Post date: [September 1, 2009, 1:07am UTC](https://forum.kirupa.com/t/document-write-inside-an-href/295531/1 "2009-09-01T01:07:30Z")

</div>

What’s the correct syntax to do a document write within an href link?

```auto

<a href="<script language='JavaScript1.2' type='text/javascript'>document.write(EventTerm);</script>" target="_blank">Terms &amp; Conditions</a>

```

I’ve tried this:

```auto
<a href="javascript:document.write(EventTerm);">Terms &amp; Conditions</a>

```

but it just writes the URL to the window.
