October 23, 2024
Chicago 12, Melborne City, USA
javascript

element.classList.remove(“u-hidden”) does not work


I am using the following code:

 var el = document.getElementById("MY_ITEM");
 el.textContent = "TEST";
 el.classList.add("success_message");
 el.classList.remove("u-hidden");

Everything works up until the line 4. No error message, just that class u-hidden does not get removed from the element so I cannot see it in the browser. Is there a better way to do that?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video