Put a JavaScript var into an HTML attribute?

Tuskus

New member
Specifically, I want to put this variable:
var domain=window.location.hostname;

into this value attribute:
<input type="hidden" name="sitesearch" value="DOMAIN VAR GOES HERE">
 
Back
Top