Created
August 6, 2019 14:54
-
-
Save dacresni/bdd84793b634354463f20bbdbf475016 to your computer and use it in GitHub Desktop.
create islands accordding to a rulee
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
<script> | |
var islands = document.querySelectorAll("h3 + ul"); // returns array | |
islands.forEach(function (child) { | |
let par = child.parentNode ; | |
let pre = child.previousElementSibling; | |
var sec = document.createElement('section'); | |
par.replaceChild(sec,pre); | |
sec.appendChild(pre); | |
sec.appendChild(child); | |
sec.setAttribute("class","standout" ); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment