Execute a script when a Web Storage area is updated in HTML?

HTMLWeb DevelopmentFront End Technology

Use the onstorage attribute in HTML to execute on Web Storage area update. You can try to run the following code to implement onstorage attribute −

Example

<!doctype html>
<html>
   <head><title>HTML onstorage</title>
   </head>
   
   <body>
      <h2>Welcome</h2>
      <body onstorage = "javascript:alert('Your learning journey!');">
      Demo text</body>
   </body>
</html>
raja
Published on 14-Mar-2018 10:46:25
Advertisements