Skip to content

Instantly share code, notes, and snippets.

View emdagon's full-sized avatar

Emilio Daniel González emdagon

View GitHub Profile
// Create an absolute jQuery selector for a DOM element.
//
// + el - Element to select.
//
// Returns String selector.
function makeSelector(el) {
var tag, index, stack = [];
for (; el.parentNode; el = el.parentNode) {
tag = el.tagName;