NickyTheWrench NickyTheWrench - 6 months ago 35
HTML Question

Inserting a javascript variable into onclick

I'm trying to insert a JavaScript variable into an href, and make it open in a new window.

Here is my code:

<a href="" onclick="'?VALUE='+testVALUE;, '_blank'); return false;">Click Here</a>

var testVALUE = '1AB56';

The URL should look like this:

Can someone please tell me where I'm going wrong?
Thanks for your help!


There's a ; in the middle of the argument you pass to Just after testVALUE