 <p>Try this:</p> <pre><code>jQuery(function ($) { if (typeof (window.localStorage) != "undefined") { // will get value of specific id from the browser localStorage and set to the input $("input[type=text]").val(function () { return localStorage.getItem(this.id); }); // will set values in browser localStorage for further reference $("input[type=text]").on("change", function () { localStorage.setItem(this.id, $(this).val()); }); } }); </code></pre> <p>Here is a working <a href="http://jsfiddle.net/sf3ZU/1/" rel="nofollow">Demo</a>.</p> <p><strong>Details:</strong></p> <p>Using local storage in modern browsers is ridiculously easy. All you have to do is modify the <code>localStorage object</code> in JavaScript. You can do that directly or (and this is probably cleaner) use the <code>setItem()</code> and <code>getItem()</code> method:</p> <pre><code>localStorage.setItem('favoriteflavor','vanilla'); </code></pre> <p>If you read out the favoriteflavor key, you will get back “vanilla”:</p> <pre><code>var taste = localStorage.getItem('favoriteflavor'); // -&gt; "vanilla" </code></pre> <p>To <strong>remove</strong> the item, you can use — can you guess? — the <code>removeItem()</code> method:</p> <pre><code>localStorage.removeItem('favoriteflavor'); var taste = localStorage.getItem('favoriteflavor'); // -&gt; null </code></pre> <p>That’s it! You can also use <strong>sessionStorage</strong> instead of <strong>localStorage</strong> if you want the data to be maintained only until the browser window closes.</p> <p>The complete <a href="http://coding.smashingmagazine.com/2010/10/11/local-storage-and-how-to-use-it/" rel="nofollow">reference here</a>. It should give you more knowledge about <code>localStorage</code>.</p>