StorageEvent key Property
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 »
Definition and Usage
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