Can anyone help me with this, I can’t find a script on the internet that does this in jQuery. I need to remember the last state of drop down menu so that on page load the drop down option is already selected. The cookie expiration date should be 90 days or let me specify in the script. Since I already use jQuery on my page I want this cookie script to use jquery, jquery cookie plugin. Thank you in advance. I’m not a programmer, but I try.
<body onLoad="GETcookie()">
<select onChange="SETcookie()">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
With the plugin that I’ve included, you can get and set cookies.
Your code would look a little something like this:
Here is what you
selectwould look like:Here’s a demo of it on jsFiddle: http://jsfiddle.net/RastaLulz/3HxCF/3/
Here’s the jQuery cookie plugin incase you don’t already have it: http://pastebin.com/CBueT8LP