0

html:

<form id="testform"> <p><input type="text" name="one"></p> </form> 

js:

$(function () { $('input[name="one"]').change(function(){ $.cookie("one", $('input[name="one"]').val(), {expires: 7}); }); }); 

Yet when I close the browser and open it the value is not there.

1 Answer 1

1

You can set the value of your input on page load:

$(function () { $('input[name="one"]').val($.cookie('one')) $('input[name="one"]').change(function(){ $.cookie("one", $('input[name="one"]').val(), {expires: 7}); }); }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.