Let's say I gave this code:
<input type="hidden" id="field" name="field" value="1">
<button id="change">Change</button>
And this javascript:
alert($("#field").val());
$("#change").on("click", function(){
var newValue = parseInt($("#field").val()) + 1;
$("#field").val(newValue);
alert($("#field").val());
});
If I change the value, go to a different page and then use the back button, in chrome and firefox the latest value is shown while in IE the default value. How to fix that without using sessionstorage?