Article

Saving a string to a cookie

https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js
Copy to clipboard

To set a value to a cookie we should write: https://raw.githubusercontent.com/finsweet/jqueryCourse/main/cookies/ex1.js?actionable=true The code above will create a cookie named username and assign the value john. https://raw.githubusercontent.com/finsweet/jqueryCourse/main/cookies/ex2.js?actionable=true The code above will store whatever the value of page_title into a cookie named page

<script>
$(document).ready(function(){
  XT1
});
</script>
Copy to clipboard
Send to Live Demo

Live demo

<script>    
$(document).ready(function() {
  XT1
});
</script>
<script>
  
</script>
Copy to clipboard
Press the Run Demo button to execute the scripts above.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Your browser is too small

Resize your browser to be at least 769px wide.