What is HTML5 Web Storage

In this article I have described the Web Storage in HTML5
  • 1990


HTML 5 web storage, the most common method for storing data locally on a user's machine was to use cookies and sessions. HTML 5 web storage allows a developer the freedom to store large amounts of data on the clients machine unencrypted data to be transmitted to the server and stored items are available on the entire domain.

Browser Support

Browser Support
Internet Explorer v8+ Yes
FireFox v3.5+ Yes
Google Chrome v4+ Yes
Safari v4+ Yes
Opera v10.5+ Yes

Note: Internet Explorer 7 and earlier versions, do not support web storage.

// Yes!  local Storage support!
local Storage - stores data with no expiration date.

Example of web storage

<!DOCTYPE html>
function Add()
                      if (localStorage.Add)
                       document.getElementById("result").innerHTML="clicked the button 10 Add: " + localStorage.Add + " time(s).";
                          document.getElementById("result").innerHTML="Sorry, your browser does not support web storage.....";
<p><button onclick="Add()" type="button">Add</button></p>
<div id="result"></div>
<p>To see the Sum:</p>
<p>Close the browser tab, and try again, and the Sum will continue:</p>

web storege.jpg
Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.