Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

domlight.js

1.1.2 • Public • Published

domlight.js

domlight.js is a library to highlight DOM elements.

Developed by Florian Eckerstorfer in Vienna, Europe.

Installation

You can install domlight.js using NPM:

npm install domlight.js

Usage

Use the highlight() and unlight() methods of the Domlight object to highlight an element or remove the highlight.

var domlight = new Domlight();
 
domlight.highlight(document.querySelector('#elem1'));
domlight.unlight(document.querySelector('#elem1'));

You can change the color and style of the highlight by passing an settings object to the constructor:

var domlight = new Domlight({
    'borderColor':     'rgba(126, 211, 33, 0.7)',
    'backgroundColor': 'rgba(126, 211, 33, 0.2)',
    'borderWidth':     1
});
 
domlight.highlight(document.querySelector('#elem1'));

You can highlight multiple elements by providing a NodeList to highlightAll(). The highlight can be removed using unlightAll().

domlight.highlightAll(document.querySelectorAll('#my-list li'));
domlight.unlightAll(document.querySelectorAll('#my-list li'));

Changelog

No version released yet.

License

The MIT license applies to domlight.js. For the full copyright and license information, please view the LICENSE file distributed with this source code.

install

npm i domlight.js

Downloadsweekly downloads

8

version

1.1.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability