I know that document.getElementById()
won't work with several ids. So I tried this:
document.getElementsByClassName("circle");
But that also doesn't work at all. But if I use just the document.getElementById()
it works with that one id. Here is my code:
let toggle = () => {
let circle = document.getElementsByClassName("circle");
let hidden = circle.getAttribute("hidden");
if (hidden) {
circle.removeAttribute("hidden");
} else {
circle.setAttribute("hidden", "hidden");
}
}