This is a method available on all elements that looks up the element tree. It’s like a reverso querySelector(). So, I could get the heading for the current section in this m…
For example, myElement.querySelector('.my-class') will only match elements that have the class my-class and are descendants of myElement.
You should have just passed a second parameter to the toggle method. If it comes try, your class will be added to the element.