yuvarajupadhyaya

Local storage

Oct 13th, 2022 (edited)
1,339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.33 KB | Software | 0 0
  1. <html>
  2. <head>
  3. <title>
  4. Test Local storage
  5. </title>
  6. </head>
  7. <body>
  8. Hello guys..
  9. <script>
  10. var isLoggedIn=localStorage.getItem('isLoggedIn');
  11.  
  12. if(isLoggedIn=='1')
  13. {
  14.   document.write('welcome...');
  15. }
  16.  
  17. localStorage.setItem('isLoggedIn','1');
  18. //to remove item
  19. //localStorage.removeItem('isLoggedIn');
  20. </script>
  21. <body>
  22. </html>
Advertisement
Add Comment
Please, Sign In to add comment