   for(let i=0;i<selids.length;++i)
    {
        let itm = db[selids[i]];
        try {
            var newitem = sanitizeJSON(itm);
            ++matchcount;
            db[selids[i]] = newitem;
        } catch (e) {
            console.log("Error replacing string: " + e);
        }
    }

    contentsDiv.innerText = `Replaced ${matchcount} matching elements`;
    contentsDiv.scrollTop = 0;
}

function replacejsondatainsel()
{
    let search = document.getElementById('swap_fieldname').va