Skip to content

Instantly share code, notes, and snippets.

@nmtitov
Created November 30, 2012 18:49
Show Gist options
  • Select an option

  • Save nmtitov/4177696 to your computer and use it in GitHub Desktop.

Select an option

Save nmtitov/4177696 to your computer and use it in GitHub Desktop.
var $es = [];
var findLeaves = function(i, $root) {
console.log($root);
$children = $root.children();
if($children.length > 0) {
$children.each(findLeaves);
}
else {
$es.push($root);
}
}
var rr = jQuery('#section-summary');
findLeaves(0, rr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment