Socket
Socket
Sign inDemoInstall

maxlength-contenteditable

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    maxlength-contenteditable

Simple maxlength plugin validator for contenteditable html , this plugin do not allow you to put more than the specified max length allowed, paste from clipboard is also checked


Version published
Weekly downloads
506
decreased by-9.16%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Max length plugin for contenteditable HTML attribute

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.

Demo here

Installation

npm
$ npm install maxlength-contenteditable --save
yarn
$ yarn add maxlength-contenteditable --save

unpkg CDN

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>

initialize

you have 3 ways to do it :

CommonJS

var maxlengthContentEditableLib = require('maxlength-contenteditable');

ES6 import

import {maxlengthContentEditable} from 'maxlength-contenteditable';

Global variable (only if you added the script via CDN in your index.html file)

maxlengthContentEditableModule.maxlengthContentEditable();

Example of use

<div contenteditable="true" data-max-length="10"></div>

Compatibility

IE 9+ , Chrome , Firefox , Opera

Keywords

FAQs

Last updated on 03 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc