HTML DOM Storage Event

The HTML DOM storage event triggers when there has been a change in the storage area of the window. The storage event is triggered only if the other window makes the storage area change for a window. This event doesn?t bubble and is cancellable too.

Syntax

Following is the syntax for ?

window.addEventListener("storage", SCRIPT);

Example

Let us look at an example for the Storage Event ?



Storage Event Example

Create the visit localStorage item by clicking the below button

Output

This will produce the following output ?

On clicking the CHECK button ?

On entering localstorage in the console tab in the developer tools ?

Updated on: 2019-08-20T05:52:26+05:30

246 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements