Add the replace() function to DOMTokenList interface. We can use it like element.classList.replace('inactive', 'active').
Docs: https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/replace