There is an html as follows:
<input id="currency_factor" type="text" style="display:none;" value="20"/>
And there is a jquery function:
$(document).ready(function(){
var currency_factor = $('#currency_factor').val()
alert(currency_factor);
}
Upon refresh the html line shows on the browser as:
<input id="currency_factor" type="text" style="display:none;" value="0"/>
But jquery returns 20.
Why is this happening?