Skip to content

lokeshjain2008/css-selector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

css-selector

How to use.

  1. include this script or better to include min file (dist/lokesh_pushup.min.js).

  2. call

 
 var disposeSelector = Selector.activateSelector()

  
  1. click on the page element. That's it.

  2. If you want to stop seeing css-selectors on the page, you kill it.

disposeSelector(); //handler will be removed from the page.

InDepth

  • If you just want to use with other functions and control the output then you should use calculateCssSelector function. as

     	
       var cssSelectorForNode = Selector.calculateCssSelector(node);
  • If you want lib. to display CSS-Selector on the page but want to handle they when to call or where to add, then use displaySelector. e.g. if you are using jQuery.

     $(document).ready(()=>{
     	$(document).on('click', Selector.displaySelector);
     });				
  • Use activateSelector. If you don't want to control and want to use working model. you can disable it anytime.

     	Selector.activateSelector()

Notes:

  1. For more Read the codebase. refer file loeksh_pushup.js

  2. For production use file dist/lokesh_pushup.min.js.

  3. Selector.activateSelector() will note work in IE<8. for more follow link and due to Array.from API.

About

Simple JavaScript library to create css-selector on the page.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published