Skip to content

Instantly share code, notes, and snippets.

@getanwar
Last active October 2, 2016 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save getanwar/1b8e85c910458dcf6c3c to your computer and use it in GitHub Desktop.
Save getanwar/1b8e85c910458dcf6c3c to your computer and use it in GitHub Desktop.
JS: Treehouse - Track List (console)
//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