Skip to content

Instantly share code, notes, and snippets.

@czbaker
Created June 29, 2015 19:24
Show Gist options
  • Select an option

  • Save czbaker/3b8469287d0339933557 to your computer and use it in GitHub Desktop.

Select an option

Save czbaker/3b8469287d0339933557 to your computer and use it in GitHub Desktop.
var liArray = document.querySelector('.button');
liArray.forEach(function(element) {
// Grab the class name you need:
var theClass = element.id.substr(0, element.id.length-7);
// Grab the link inside.
var theLink = element.querySelector('a');
// Do other things?
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment