Simple maxlength plugin validator for contenteditable html attribute, this plugin do not allow you to put more than the specified max length, paste from clipboard is also checked.
$ npm install maxlength-contenteditable --save
$ yarn add maxlength-contenteditable --save
You can also skip yarn/npm install by using repos on the cdn
<script src="https://unpkg.com/maxlength-contenteditable@1.0.1/dist/maxlength-contenteditable.js"></script>
you have 3 ways to do it :
var maxlengthContentEditableLib = require('maxlength-contenteditable');
import {maxlengthContentEditable} from 'maxlength-contenteditable';
maxlengthContentEditableModule.maxlengthContentEditable();
<div contenteditable="true" data-max-length="10"></div>
IE 9+ , Chrome , Firefox , Opera