Thanks @GH5T this worked nicely for my use case.

For anyone wondering how to manage reverting all other cells to lower z-indices while also setting the current cell higher, here’s how I did it:

const tag = `tag-current cells unique id`;

const tagEl = document.getElementById(tag);

// Set the z-index of the clicked element
tagEl.style.zIndex = 9999;

// Revert z-index of all other elements
const allTags = document.querySelectorAll('[id^="tag-"]'); // Select all elements with IDs starting with "tag-"
allTags.forEach((el) => {
    if (el.id !== tag) {
        el.style.zIndex = 10; // Revert other elements to a lower z-index
    }
});