Lightweight Text Selection JavaScript Library – text-select

Category: Javascript , Text | March 12, 2019
Author: ali-kamalizade
Views Total: 74
Official Page: Go to website
Last Update: March 12, 2019
License: MIT

Preview:

Lightweight Text Selection JavaScript Library – text-select

Description:

text-select is a pure JavaScript text selection library which gives you the ability to select the full or a part of the text of a given element.

How to use it:

Install & Import.

# NPM
$ npm install @alidev/text-select --save
import {selectElementText, selectText} from '@alidev/text-select';

Select the full text of an element.

selectElementText(document.getElementById('paragraph'));

Select a part of the text based on the string you specify.

selectText(document.getElementById('paragraph', 'text to select'));

You Might Be Interested In:


Leave a Reply