Refactor aria-expanded attribute check
This commit is contained in:
parent
1bc88b6c95
commit
4ef8ebd499
|
@ -96,10 +96,10 @@
|
||||||
const showClass = "navbar__links--show";
|
const showClass = "navbar__links--show";
|
||||||
navbarLinks.classList.toggle(showClass);
|
navbarLinks.classList.toggle(showClass);
|
||||||
|
|
||||||
if (navbarToggle.getAttribute("aria-expanded") === "false") {
|
if (navbarToggle.ariaExpanded === "false") {
|
||||||
navbarToggle.setAttribute("aria-expanded", "true");
|
navbarToggle.ariaExpanded = "true";
|
||||||
} else {
|
} else {
|
||||||
navbarToggle.setAttribute("aria-expanded", "false");
|
navbarToggle.ariaExpanded = "false";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue