Chapter 10: JavaScript and Cookies

Return to Chapter 10

 

To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Baking Your First Cookie

See it run: Baking Your First Cookie

Script 10.1

This HTML creates a simple form. We can then store the user's entry in the form in a cookie.

Script 10.2

This JavaScript sets a browser cookie.