Created
July 16, 2017 11:24
-
-
Save ravituvar/0ecf6697926e4510d6d12a907a4750ca to your computer and use it in GitHub Desktop.
Get topics in plural sight
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 list = document.getElementsByTagName("section"); | |
var counter=0; | |
for (var i=0; i<list.length; i++) { | |
if ( list[i].className.match(/\bmodule\b/) ) { | |
var header_text = list[i].getElementsByTagName("h2")[0].innerText; | |
var ul = list[i].getElementsByClassName('clips'); | |
var li_list = ul[0].getElementsByTagName('h3'); | |
if ( li_list.length > 1 ) { | |
console.log("------" + header_text + "------"); | |
for (var y=0; y<li_list.length; y++) { | |
counter += 1; | |
console.log(counter + " - " + li_list[y].innerText); | |
} | |
console.log(" "); | |
console.log(" "); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment