StorageEvent newValue Property
Example
Get the new value of the storage item that changed:
window.addEventListener("storage", myFunction);
function myFunction(event)
{
var x = "Value: " + event.newValue;
document.getElementById("demo").innerHTML
= x;
}
Try it Yourself »
Definition and Usage
The newValue property returns the new value of the changed storage item.
Note: The storage event is only triggered when a window other than itself makes the changes.
Browser Support
Property | |||||
---|---|---|---|---|---|
newValue | Yes | Yes | Yes | Yes | Yes |
Syntax
event.newValue
Technical Details
Return Value: | A String, representing the new value of the storage item |
---|
Related Pages
StorageEvent reference: The key Property
StorageEvent reference: The oldValue Property
StorageEvent reference: The storageArea Property
StorageEvent reference: The url Property