Get value from localStorage - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window localStorage


Get value from localStorage

Demo Code

ResultView the demo in separate window

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

Related Tutorials