Created
December 21, 2011 16:01
-
-
Save t0d0r/1506533 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* 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