I'm trying to implement what I believed to be an easy function to delete a record from an indexeddb database. All I want to achieve is to delete a record (object) from the DB. Here is the code I'm using:

btnDelete.addEventListener("click", function () {
var id = document.getElementById("txtID").value;

var transaction = db.transaction("people", "readwrite");
var objectStore = transaction.objectStore("people");
var request = objectStore.delete(id);
request.onsuccess = function(evt) {
console.log("It's gone!");


}, false);

It executes and logs the correct info as if the object is deleted, but when I open the DB no records have been deleted? Any suggestions?