Why is querySelectorAll not working?

  • 0
    I am writing a website, took up a block of code with tabs and made the following function.
    tabs ('. glazing_slider', '. glazing_block', '.glazing_content', 'active')
    where the first is a block with all the tabs, the second is the tabs themselves, the third is the content to be switched and the class.
    The problem turned out to be the following, I had a space after glazing_block, the code didn't work because of this.
    I solved the problem, but still there was a question: why didn't querySelectorAll work with a space? Because I remember that before sometimes I could write this way and it didn't seem to prevent the code from being executed.
    JavaScript Anonymous, Jun 15, 2019

  • 1 Answers
  • 0
    Because .glazing_block [space] and .glazing_block are not equivalent strings. It may not matter to you in life, but in computers everything is strict.
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!