contenteditable-max-length
v1.0.0
Published
Sets the maximum number of characters that can be entered in the contenteditable element
Downloads
307
Readme
contenteditable-max-length
Set the maximum number of characters that can be entered in the contenteditable element
Getting started
npm install contenteditable-max-length --save-dev
Syntax
const unsubscribe = contenteditableMaxLength([options])
Options
element
DOM contenteditable element
maxLength
Number of maximum characters
Return value
The unsubscribe function
Usage example
import contenteditableMaxLength from 'contenteditable-max-length'
const unsubscribe = contenteditableMaxLength({
element: document.getElementById('contenteditable-element'),
maxLength: 100
})