Last active
October 2, 2016 18:35
-
-
Save getanwar/1b8e85c910458dcf6c3c to your computer and use it in GitHub Desktop.
JS: Treehouse - Track List (console)
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
//track list | |
// copy this code to console and see result on the page | |
var write = $('#track-meta'); | |
var track = '<h2>[Track] Treehouse - '; | |
track += $('h2').text() + '</h2>'; | |
write.append(track); | |
$('.course').each(function(i) { | |
var el = $(this); | |
var list = '<p><a href="' + el.find('.card-title').attr('href') + '">'; | |
list += (i + 1) + '. Treehouse - ' + el.find('h3').text(); | |
list += '</a></p>'; | |
write.append(list); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment