I reference the hidden field like:
var h = document.getElementById(\'myHiddenField\');
How can I set the value to 100, and then output the
//get value
var hidderValue = document.getElementById('myHiddenField').value;
//set value
document.getElementById('myHiddenField').value = 200;
The value
property of the element.
var h = document.getElementById('myHiddenField');
h.value = 100;
alert(h.value);
Maybe you want to set hidden field's value IN the html part. To do so write:
<input type="hidden" id="myHiddenField" value="100"></input>