Lightweight Text Selection JavaScript Library – text-select

Category: Javascript , Text | March 12, 2019
Authorali-kamalizade
Last UpdateMarch 12, 2019
LicenseMIT
Tags
Views616 views
Lightweight Text Selection JavaScript Library – text-select

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