In my HTML I have:
<div>
<input type="hidden" id="field" value="-1"/>
</div>
In my jQuery I have:
var fieldInput = $("#field");
if(someBoolIsTrue)
fieldInput.value = 4;
After this JS executes, I go to print the value of the hidden field
, and it tells me it's still -1
. Am I using jQuery incorrectly here?!? Thanks in advance!