0.0.1 • Published 11 years ago

get-query-selector v0.0.1

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

#getQuerySelector

returns the query selector for a given dom node. The result can be directly fed to document.querySelector. It uses body, #ids and :nth-child(i) to compose the selector.

##Usage

var getQuerySelector = require("get-query-selector");

var aNodes = document.getElementByTagName("A");
var aNode = aNodes[aNodes.length - 1];

var selector = getQuerySelector(aNode);