Created
July 24, 2018 14:25
-
-
Save llagerlof/9546c0afdf1bb4a0823115065cdcd9ae to your computer and use it in GitHub Desktop.
Console javascript loop through elements, add class and set attribute value (on line)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodes = document.querySelectorAll("h1[style='margin:0px;']"); for(i=0; i<nodes.length; i++) { nodes[i].classList.add("opened"); nodes[i].setAttribute("aria-expanded", "true"); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment