# After passing variable to HREF tag, How to use target statement?

**URL:** <https://forum.kirupa.com/t/after-passing-variable-to-href-tag-how-to-use-target-statement/296430>\
**Category:** web dev\
**Created:** [September 15, 2009, 1:34am UTC](https://forum.kirupa.com/t/after-passing-variable-to-href-tag-how-to-use-target-statement/296430 "2009-09-15T01:34:45Z")\
**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 15, 2009, 1:34am UTC](https://forum.kirupa.com/t/after-passing-variable-to-href-tag-how-to-use-target-statement/296430/1 "2009-09-15T01:34:45Z")

</div>

Here’s the code that allows me to pass a URL to an HREF tag:

```auto
<a href="javascript:location.href=EventTerms">Terms &amp; Conditions</a>

```

However, I need to open this URL in a new window (since the user will click this link on a registration form). I’ve tried this kind of thing, but it just opens a new blank window:

```auto
<a href="javascript:location.href=EventTerms" target="_blank">Terms &amp; Conditions</a>

```

What’s the correct way to do this?
