Skip to content

Commit

Permalink
Switch classList to use contains? (mdn#37962)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkardell authored Feb 4, 2025
1 parent 8bc1b82 commit 5c1847f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/en-us/web/css/content-visibility/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ htmlElem.addEventListener("click", showHide);
document.addEventListener("keydown", showHide);

function showHide() {
if (divElem.classList[0] === "show") {
if (divElem.classList.contains("show")) {
divElem.classList.remove("show");
divElem.classList.add("hide");
} else {
Expand Down

0 comments on commit 5c1847f

Please sign in to comment.