-2

I am currently learning to code JS and like probably many other people before, I'm writing a ToDo List.

But at this point I've got a problem.

let DivNone = document.querySelectorAll('#div2, #btn3');


DivNone.style.display = 'none'; 

Why doesn't it work?

ottotoni
  • 1
  • 1
  • 4
    That second example should work. Please add a [mre]. – 0stone0 Aug 25 '23 at 15:51
  • 1
    `querySelectorAll()` does not return a single element; you will need to iterate over it to update each element's style. – mykaf Aug 25 '23 at 16:05
  • 2
    [What do querySelectorAll and getElementsBy* methods return?](https://stackoverflow.com/q/10693845) – VLAZ Aug 25 '23 at 16:07

0 Answers0