npm.io
1.0.2 • Published 3 years ago

html-picker

Licence
MIT
Version
1.0.2
Deps
0
Size
11 kB
Vulns
0
Weekly
0
Stars
1

node-picker

It's a JavaScript library for interactively picking the DOM elements and displays the HTML tags.

npm version

Install

``npm install --save html-picker`

Usage

Create an instance of the htmlPicker class, and call its start() method to start picking. Provide an onHover or onClick callback to get the picked element(s). Call stop() to stop picking and remove the overlay from the DOM.

import { htmlPicker } from "html-picker";

onHover: (el) => console.log(`Hover: ${el}`),
onClick: (el) => console.log(`Click: ${el}`),

const picker = new htmlPicker(onHover, onClick);
picker.start();
picker.stop();