Created
September 5, 2023 19:43
-
-
Save obfusk/8c5f8ff85cd1e4aa38d73751f8dd2fac to your computer and use it in GitHub Desktop.
replace all but the first h2 with h3 using JS
This file contains 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
[...document.getElementsByTagName("h2")].forEach((x, i) => { if (i > 0) { y = document.createElement("h3"); y.innerHTML = x.innerHTML; x.parentNode.replaceChild(y, x) } }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment