Skip to content

rishihahs/domtalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

domtalk

Generate CSS Selectors for DOM elements.

For example, this selector can be sent over the wire, and a library like jQuery/Sizzle or Qwery (or just document#querySelector) can then be used to get the element from the generated selector.

browser support

methods

var domtalk = require('domtalk')

The domtalk object has the following function:

domtalk.getSelectorFromElement(el)

el is a DOM element

example

var domtalk = require('domtalk');
var el = ...
var selector = domtalk.getSelectorFromElement(el);

console.log(selector); // "body *:nth-child(1) *:nth-child(3) *:nth-child(3)"

license

MIT, See LICENSE

About

Generates CSS Selector for a DOM element

Resources

License

Stars

Watchers

Forks

Packages

No packages published