I am trying to understand why the new class is not applied after the change. I see the new class name in my console but color of the element is not changing.
console.log(“I am inside my function”);
const element = document.getElementById(“someid”);
element.classList.remove(“class1”);
element.classList.add(“class2”);
console.log(element.className);
Output in the console shows “class2”. Am I doing something wrong?