Execute
Save
Share
Share link
share
share
share
Team
Public Teams
Comments
0
Created By:
Guest
Title:
Jquery Setting Cookie
Title
Description
Edit
Copy Link
Login
Email *
Password *
Login
OR
Create Account
Screen Name *
Email *
Password *
Retype Password *
Team Access Code
Register
Public CodeBins
HELP
--Select Theme--
Ambiance
Blackboard
Cobalt
Eclipse
Elegant
Erlang-Dark
Lesser-Dark
Monokai
Neat
Night
Rubyblue
Vibrant-Ink
Xq-Dark
New CodeBin
CodeBins Versions
Jquery Setting - V.8
Jquery Setting - V.7
Jquery Setting - V.6
Jquery Setting - V.5
Jquery Setting - V.4
Jquery Setting - V.3
Jquery Setting - V.2
Jquery Setting - V.1
Compare Versions
Recent CodeBins
View All CodeBins
$(document).ready(function() { $("#set_state").change(function() { var theState = $(this).val(); $.cookie('se', theState, { expires: 5, path: '/' }); }); $("#btncookie").click(function() { alert("Your Selected Value from Cookie is : " + $.cookie('set_state')); }); $("#btndelcookie").click(function() { $.cookie('set_state', '', { expires: -1 }); $("#set_state").val(""); alert('Cookie is deleted now, try to get cookie..!'); }); });
Bottom of Page
In Head
On Load
On Ready
Setting
Validate
Copy
Format
#set_state{ font-size:14px; border:1px solid #333; color:#6215ef; }
Setting
Validate
Copy
Format
<select id="set_state" name="state"> <option value="" selected="selected"> </option> <option value=""> None </option> <option value="AL"> AL </option> <option value="AK"> AK </option> <option value="AZ"> AZ </option> <option value="AR"> AR </option> <option value="CA"> CA </option> <option value="CO"> CO </option> <option value="CT"> CT </option> <!-- no need to post them all here --> </select> <input type="button" id="btncookie" value="get cookie" /> <input type="button" id="btndelcookie" value="delete cookie" />
No Doc Type
HTML5
HTML 4.01 Transitional
HTML 4.01 Strict
HTML 4.01 Frameset
XHTML 1.1
XHTML 1.0 Transitional
XHTML 1.0 Strict
XHTML 1.0 Frameset
Copy
Format
Download
×
Code Description
×
Difference of Versions
HTML
CSS
JS
×
JS Error
×
CSS Error
Errors
Warnings
×
JavaScript Setting
JS Libraries:
Chrome Frame 1.0.3
Dojo 1.8.0
Dojo 1.7.3
Dojo 1.7.2
Ext Core 3.1.0
jQuery 1.8.0
jQuery 1.7.2
jQuery 1.6.0
jQuery 1.5.0
jQuery 1.4.4
jQuery 1.4.0
jQuery-min 1.7.2
jQueryUI-min 1.8.21
MooTools more-1.4.0.1-full
MooTools core-1.4.5-full
MooTools core-1.4.1-full
Prototype 1.7.1.0
script.aculo.us 1.9.0
SWFObject 2.2
Twitter Bootstrap 2.0.4
WebFont Loader 1.0.28
yui 3.5.1
User Libraries:
Upload File
3
jquery.cookie.js
JavaScript URL(s):
×
CSS Setting
CSS Libraries:
jQueryUI 1.8.21
Twitter Bootstrap 2.0.4
User Libraries:
Upload File
CSS URL(s):