StorageEvent key Property

❮ DOM Events ❮ StorageEvent

Example

Get the name of the storage item that changed:

window.addEventListener("storage", myFunction);

function myFunction(event) {
  var x = "Key: " + event.key;
  document.getElementById("demo").innerHTML = x;
}
Try it Yourself »

Description

The key property returns the name of the changed storage item.

Note: The storage event is only triggered when a window other than itself makes the changes.


Browser Support

Property
key Yes Yes Yes Yes Yes

Syntax

event.key

Technical Details

Return Value: A String, representing the name of the storage item

Related Pages

StorageEvent reference: The newValue Property

StorageEvent reference: The oldValue Property

StorageEvent reference: The storageArea Property

StorageEvent reference: The url Property


❮ DOM Events ❮ StorageEvent

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.