Get value from localStorage - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window localStorage

Description

Get value from localStorage

Demo Code

ResultView the demo in separate window

<!doctype html>
<html lang="en">
   <head> 
      <title>Dialog Box Witout Close Button</title> 
      <link rel="stylesheet" href="https://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css"> 
      <script type="text/javascript">
var firstname = localStorage.firstname;
var lastname = localStorage.lastname;
   console.log("Your name is: " +firstname + " " + lastname);
 
      </script> 
   </head> 
   <body>
       You have been alerted on this page.  
   </body>//from ww w  . j ava2s.  c  o m
</html>

Related Tutorials