I have a form that receives data and I am trying to save the first two pages of received data into localStorage:
<form id="myForm" method="post">
Font Size (px): <input id="fontsize" type="text" name="fontsize" />
</form>
<script type="text/javascript">
var inputX = document.getElementById('fontsize');
var size = parseFloat(inputX.value);
localStorage.setItem('size', size);
On the second page, I want to use jQuery to increase the font size:
$(document).ready(function(){
var storedSize = localStorage.getItem('size');
$("#info").css('font-size', storedSize + 'px');
});
However, nothing seems to happen. What could be the issue here?