0.1.7 • Published 8 months ago

jquery-simple-txt-counter v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

jQuery Simple Text Counter

Install

using npm:

npm install jquery-simple-txt-counter

Usage

import 'jquery-simple-txt-counter/jquery-simple-txt-counter';

or

<script src="jquery-simple-txt-counter/jquery-simple-txt-counter.js"></script>

and

$('textarea').simpleTxtCounter({
    maxLength: 100,
    countText: 'Maximum:',
    countElem: '<div class="form-text"></div>',
    lineBreak: false,
});

Example

  • With customized insert
<div class="btn-group">
    <textarea maxlength="200"></textarea>
    <button type="button">ADD</button>
</div>
$('textarea').simpleTxtCounter({
    after: '.btn-group'
});

Options

OptionDefaultDescription
afterundefinedselector to after inserting the counter element
maxLengthundefinedMaximum size (maxlength attribute is used if it exists)
countTextundefinedPre text before counter
countElem<div/>Counter element
lineBreaktrueIf false, it does not allow line breakage
0.1.7

8 months ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago