From 544401abd5bad50acf11737c2a59fabf2587856c Mon Sep 17 00:00:00 2001 From: Enjel Hutasoit <28510687+enjelhutasoit@users.noreply.github.com> Date: Mon, 25 Feb 2019 12:58:06 +0700 Subject: [PATCH] Add example explaination (#33226) --- guide/english/html/html5-web-storage/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guide/english/html/html5-web-storage/index.md b/guide/english/html/html5-web-storage/index.md index 7745d21f24..252b172e21 100644 --- a/guide/english/html/html5-web-storage/index.md +++ b/guide/english/html/html5-web-storage/index.md @@ -3,7 +3,7 @@ title: HTML5 Web Storage --- ## HTML5 Web Storage -Web storage allows web applications to store up to 5MB of information in browser storage per origin (per domain and protocol). +With web storage, web applications can store data locally within the user's browser. Web storage allows web applications to store up to 5MB of information in browser storage per origin (per domain and protocol). ### Types of Web Storage @@ -28,6 +28,9 @@ sessionStorage.setItem("foo", "bar"); // Get Item sessionStorage.getItem("foo"); //returns "bar" ``` +Example explained: +Create a localStorage name/value pair with name="foo" and value="bar" +Retrieve the value of "foo" and insert it into the element with id="foo" Since the current implementation only supports string-to-string mappings, you need to serialize and de-serialize other data structures.