GithubHelp home page GithubHelp logo

shivamdevs / dom-selector Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 38 KB

Get NodeName, classList, and id along with width, height, display, padding, margin and border of elements without opening Console.

License: MIT License

JavaScript 100.00%
dom-selection dom-selector javascript

dom-selector's Introduction

Dom Selector

Version: 1.1.0

Get NodeName, classList, and id along with width, height, display, padding, margin and border of elements without opening Console.

Installation

Dom Selector can be loaded to any websites by placing any one of these codes on the head of the document.

<!-- Use Development CDN -->
<script src="https://cdn.jsdelivr.net/gh/shivamdevs/dom-selector@latest/selector.js" defer></script>
<!-- or Use Production CDN -->
<script src="https://cdn.jsdelivr.net/gh/shivamdevs/dom-selector@latest/selector.min.js" defer></script>

Adding defer can help delay Dom-Selector loading, preventing it from increasing page load time.

Usage

Implementation

DomSelector can be called as a Promise.

// Call Dom-Selector
DomSelector(); // returns Promise

// Or use top level async await function
async function selector() {
    const element = await DomSelector();
}

// Optionally it takes only one boolean parameter
DomSelector(true); //This keeps the selection on the page until user closes it.

Name of the function DomSelector can be changed on the script file on local downloaded files.

Options

An optional boolean parameter showPreview can be passed to keep selection in view until user closes it.

DomSelector(showPreview); // boolean value true|false

Auto Select

An autoSelect function can be called to show a start icon on the document by default.

DomSelector.autoSelect(showPreview); // returns :void

Limitation

  • Restricted to top window only
  • Can't distinguish between before and after pseudo-elements

Contribution

dom-selector's People

Contributors

shivamdevs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.