LocalStorage Saving as Strings : <p>I'm trying to make a speeding application that asks the user to input a pre-defined speed limit through an input, I have used local storage to store the number but it stores it like "number" instead of just the number it places quotation marks around them making it a string and useless in  my application.</p>

<p>Here is the JS</p>

<pre><code> var limit = 20;
 var limitfield = document.getElementById('limit1') //Places limit1 field from HTML into variable 
 limitfield.addEventListener('input', updateStorage); //Adds eventlistener to listen to input in limit1 field then call method

 function updateStorage (){
 localStorage.setItem('limitfield', limitfield.value); //After obtaining the input from eventlistener store the value in variable
  setPreference();
                             }

 function setPreference(){
  limit = localStorage.getItem('limitfield'); //variable created that retrieves value  
                         }
</code></pre>
