Saturday, October 25, 2025
HomeLanguagesJavascriptHTML DOM indexedDB databases() Method

HTML DOM indexedDB databases() Method

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

Syntax:

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.




<!DOCTYPE HTML> 
<html>  
<head>
    <title>indexedDB databases() method</title>
</head>   
<body style="text-align:center;">
    <h1 style="color:green;">  
        neveropen  
    </h1> 
    <p> 
    HTML | indexedDB databases() method
    </p>
    <button onclick = "Geeks()">
    Click Here
    </button>   
    <script> 
        function Geeks(){
         var request = 
           window.indexedDB.open("newDatabase", 1);
         console.log(window.indexedDB.databases())
     }
  </script> 
</body>   
</html>


Output:

Before Button Click:

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

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS