maj-text-counter
v1.0.5
Published
A jQuery plugin for counting and limiting characters/words on text input, or textarea and element using .val() method.
Downloads
4
Maintainers
Readme
maj Text Counter Plugin
A jQuery plugin for counting and limiting characters/words on text input, or textarea, elements (using .val()).
Installation
Include script after the jQuery library:
<script src="/javascripts/maj-text-counter.js"></script>
Usage
Basic usage:
$('input').majTextCounter();
Limit to a maximum words count:
$('input').majTextCounter({
wordLimit: 10,
});
Limit to a maximum caracters count:
$('input').majTextCounter({
carLimit: 10,
});
Speak french ?:
$('input').majTextCounter({
words: "mots",
letters: "lettres",
separator: " & ",
maximum: "MAX :",
});
Elements
By default the plugin add the following element after the input/textarea:
<span class="maj-text-counter">2 words | 14 letters</span>
Development
- Source hosted at GitHub
- Report issues, questions, feature requests on GitHub Issues