Skip to content

DanKnox/GenXPath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##GenXPath

A simple xpath generator for the JavaScript generation.

Developed by Dan Knox. This project rocks and uses the MIT License.

###Usage:

You can pass GenXPath a jQuery object or plain DOM element.

 xpath = new GenXPath( $('target') )
 xpath = new GenXPath( document.getElementById('target') )

GenXPath will generate and store the element's xpath and a few other useful pieces of information.

 xpath.path      // '//HTML[1]/BODY[1]/DIV[2]/UL[1]/LI[3]'
 xpath.parents   // An array of DOM elements
 xpath.position  // A jQuery position() object
 xpath.tagName   // The element's tagName

About

A simple xpath generator for the JavaScript generation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published