Article

Get Cookie values

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

To get the value of a cookie we should write: https://raw.githubusercontent.com/finsweet/jqueryCourse/main/cookies/ex7.js?actionable=true This gets the value of the username cookie, which is john. Likewise, to get the user cookie we do: https://raw.githubusercontent.com/finsweet/jqueryCourse/main/cookies/ex8.js?actionable=true To get the shopping cart cookie we do: https://raw.githubusercontent.com/finsweet/jqueryCourse/main/cookies/ex9.js?actionable=true To get all the cookies stored we do: https://raw.githubusercontent.com/finsweet/jqueryCourse/main/cookies/ex10.js?actionable=true

<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.