Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML DOM indexedDB databases() Method

Improve Article
Save Article
Like Article
  • Last Updated : 19 Jul, 2020
Improve Article
Save Article
Like Article

The databases() method of the indexedDB interface returns a list representing all the available databases in the document, with their names and versions.


dbs = indexedDB.databases();

Parameters: The method does not take any parameters.
Return value: This method returns a promise containing a list of dictionaries, each with two elements, name and version.
Example: In this example, we will open a database and hence, will get the databases using this method.

    <title>indexedDB databases() method</title>
<body style="text-align:center;">
    <h1 style="color:green;">  
    HTML | indexedDB databases() method
    <button onclick = "Geeks()">
    Click Here
        function Geeks(){
         var request = 
 "newDatabase", 1);


Before Button Click:

After Button Click: In the console, the promise can be seen.

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!