I create hidden fields in JS to hold values for use on submit. The way I create them is something like this…

Code:
var hdnTotField=opener.document.getElementById("hdn_" + valType + "_tot");
var tot = hdnTotField.value;
x.innerHTML+="<input type='Hidden' id='hdn_" + valType + "_" + tot + "' name='hdn_" + valType + "_" + tot + "' value='"+optionalVal+"'><span onmouseover=hlFlip(this,'delValue') onmouseout=hlFlip(this,'undelValue') class='undelValue' onclick=delme('"+val+"','"+valType+"',this,"+tot+")>"+val+"</span>&nbsp;";
hdnTotField.value = parseInt(tot,10)+1;


Is there a better way to do this like maybe…

Code:
var hidden = new hidden
hidden.value=”blah”
hidden.name=”hdnName”
hidden.id=”hdnID”


This would make much cleaner code.

Thanks for your thoughts.