I am trying to use val() to change the value of a hidden field in asp.net.
My jQuery is as follows:
$("#blue").val("Green");
ASP:
<asp:HiddenField ID="blue" runat="server" clientidmode="static"/>
The result I am looking for is:
<asp:HiddenField ID="blue" runat="server" value="Green" clientidmode="static"/>
Which outputs in html as:
<input type="hidden" value="Green" id="Blue" />
What I am getting:
<input type="hidden" id="Blue" />
I can get $("#blue").text("Green");
to work no problem.
The reason I want to change the value is because I am pulling the value from various json files.