Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

get-query-selector

0.0.1 • Public • Published

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);

Keywords

none

install

npm i get-query-selector

Downloadsweekly downloads

1

version

0.0.1

license

none

repository

githubgithub

last publish

collaborators

  • avatar