Skip to content

Instantly share code, notes, and snippets.

@t0d0r
Created December 21, 2011 16:01
Show Gist options
  • Save t0d0r/1506533 to your computer and use it in GitHub Desktop.
Save t0d0r/1506533 to your computer and use it in GitHub Desktop.
/* get full dom path to the element */
var path = [];
var el = $0;
do {
path.unshift(el.nodeName + (el.className ? ' class="' + el.className + '"' : ''));
} while ((el.nodeName.toLowerCase() != 'html') && (el = el.parentNode));
console.log(path.join(" > "));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment