HTML5 | Sololearn: Learn to code for FREE!

+3

HTML5

The complete way to do local storage => in 2 types? with examples!

6/18/2018 5:49:24 PM

Khentit Nadji Sabri

2 Answers

New Answer

+2

<div id="res"></div> <script> // Check browser support if (typeof(Storage) !== "undefined") { // Store localStorage.setItem("name", "test"); // Retrieve document.getElementById("res").innerHTML = localStorage.getItem("name"); } else { document.getElementById("res").innerHTML = "Sorry, your browser does not support Web Storage..."; } </script> <!--Try on web version, sololearn codeplayground dose not support this-->

+1