The DOM Storage key() Method is related to the Storage object and is used to return the name of the key with the specified index. Storage object can be either a localStorage or sessionStorage Object.
- Local storage:
- Session storage:
- Before Click:
- After Click:
- Google Chrome 4
- Internet Explorer 8
- Firefox 3.5
- Opera 10.5
- Safari 4
- HTML | DOM Storage removeItem() Method
- HTML | DOM Storage getItem() Method
- HTML | DOM Storage setItem() Method
- HTML | DOM Local Storage clear() Method
- HTML | DOM Storage Event
- HTML | DOM Storage length Property
- Difference between Primary key and Super key
- HTML | DOM KeyboardEvent key Property
- LocalStorage and SessionStorage | Web Storage APIs
- What is Internal Storage Encoding of Characters(ISCII)?
- Storage Definition Languages (SDL)
- How to add Google map inside html page without using API key ?
- HashMap replace(key, oldValue, newValue) method in Java with Examples
- HashMap replace(key, value) method in Java with Examples
- HashMap putIfAbsent(key, value) method in Java with Examples
- HashMap merge(key, value, BiFunction) method in Java with Examples
- HashMap getOrDefault(key, defaultValue) method in Java with Examples
- HashMap computeIfPresent(key, BiFunction) method in Java with Examples
- HTML | DOM HTML Object
Parameters: It accepts a parameter i.e. index to get the name of the key with that particular given index.
Return Values: It returns the name of the key in the form of the string.
Below is the HTML code to show the working of HTML DOM Storage key() Object:
Supported Browsers: The browser supported by DOM Storage key() Method are listed below:
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.