IndexedDB

Use IndexedDB for client-side storage

AdvancedTopic: Browser API
Back

JavaScript IndexedDB Program

This program helps you to learn the fundamental structure and syntax of JavaScript programming.

Try This Code
const request = indexedDB.open('MyDB', 1);
request.onsuccess = (e) => {
    const db = e.target.result;
    console.log('Database opened');
};
Output
Database opened

Understanding IndexedDB

IndexedDB provides client-side database storage.

Note: To write and run JavaScript programs, you need to set up the local environment on your computer. Refer to the complete article Setting up JavaScript Development Environment. If you do not want to set up the local environment on your computer, you can also use online IDE to write and run your JavaScript programs.

Table of Contents