onlyforbopi
9/27/2018 - 6:45 AM

JS.LocalStorageApi.DataPersistence.ex1

JS.LocalStorageApi.DataPersistence.ex1

JS.LocalStorageApi.DataPersistence.ex1

A Pen by Pan Doul on CodePen.

License.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <script>
    // Using localStorage
    // store data
    localStorage.lastName = "Bunny";
    localStorage.firstName = "Bugs";
    localStorage.location = "Earth";
    
    // retrieve data
    var lastName = localStorage.lastName;
    var firstName = localStorage.firstName;
    var location = localStorage.location;
    
    console.log("lastName just retrieved from the localStorage of your browser, for this particular web site: " + lastName);
    </script>
</head>
<body>

</body>
</html>