JSFiddle - React, Tailwind, and code Playground
HTML
<button id="reset">Reset</button>
JavaScript
$('button#reset').on("click", function () {
var db = window.openDatabase("Database", "1.0", "ApplicationDB", 200000);
db.transaction(resetDB, errorCB);
//location.reload();
});
function resetDB(tx) {
console.log('got here');
tx.executeSql("UPDATE RESULT SET Difficulty = 'Easy' ", [], querySuccess, errorCB);
}
function queryDB(tx) {
tx.executeSql("SELECT * FROM RESULT ORDER BY Level", [], querySuccess, errorCB);
}
function errorCB(tx, error) {
console.log('error:' + error.message, tx, error);
}
function querySuccess() {
console.log('success');
}