Skip to content

Instantly share code, notes, and snippets.

View robrighter's full-sized avatar

Rob Righter robrighter

View GitHub Profile
function makeSelector(el) {
var tag, index, stack = [];
while (el) {
tag = el.tagName;
index = 0
while(el && el.previousSibling){
el = el.previousSibling;
if (tag == el.tagName)
index += 1;
}