toggle: function(section){ var sections = document.querySelectorAll('[data-route]'); for (i = 0; i < sections.length; i++){ sections[i]. ... <看更多>
Search
Search
toggle: function(section){ var sections = document.querySelectorAll('[data-route]'); for (i = 0; i < sections.length; i++){ sections[i]. ... <看更多>
To remove a class from an element, you use the remove() method of the classList property of the element. Suppose you have a <div> element as follows:. ... <看更多>
querySelectorAll.bind(document); ... add class to element and replace all current classes ... reusable function to remove certain class. ... <看更多>
that = this is an antipattern in modern Javascript. If you need to use the calling context from the outer scope, use arrow functions instead ... ... <看更多>
querySelector ('li'); // Tag // Select specific element by Class document. ... of classes. The array can be modified with .add or .remove element.classList; ... ... <看更多>
... <看更多>