Skip to content

koesbong/getPathPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Purpose:

I was working on a project where all I know was the element in which a certain text/selection lives in, but need to know the full selector between the known element and the closest element with an ID.  I found a code snippet written by Andreas Blixt (http://github.com/blixt) and, with his permission, improved it.
    
Usage:

    $(selector).getPathPlus(separator);

    Sample HTML Code:

        <div id="main">
            <span>
                <p class="word">Word</p>
            </span>
        </div>
    

    $('.word').getPathPlus();
    >> "#main span p.word"
    
    $('.word').getPathPlus(' > ');
    >> "#main > span > p.word"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published