TextCount jQuery plugin to create Textarea like Twitter, and input support, no more options, easy to use, just 1 line of jquery code.

How To Create Textarea Like Twitter

Very easy, using TextCount plugin, we will create textarea like twitter, and input support.

TextCount Demo

Check demo of Textarea and Input.

TextCount Download

Download TextCount plugin with examples from Our Server.

TextCount Installation

Include jQuery before TextCount plugin, for example:

<script type="text/javascript" src="jquery-1.12.1.min.js"></script>
<script type="text/javascript" src="textcount.jquery.js"></script>

TextCount Usage

Textarea example:

<script type="text/javascript">
    jQuery(function(){
        jQuery("#textarea").TextCount( { countWrap: "#textarea-count", limitNumber: 140, disablePaste: 1 } );
    });
</script>

<p><span id="textarea-count"></span> Remaining characters</p>
<textarea id="textarea"></textarea>

Input example:

<script type="text/javascript">
    jQuery(function(){
        jQuery("#input").TextCount( { countWrap: "#input-count", limitNumber: 30, disablePaste: 1 } );
    });
</script>

<p><span id="input-count"></span> Remaining characters</p>
<input id="input" type="text" value="">

TextCount Options

countWrap: Enter CSS selector for count wrap, for example "#my-count-wrap", default is 0 (required option)

limitNumber: Enter number of maximum characters, for example 30, default is 140 (optional option)

disablePaste: This option to disable paste text, default is 1, 1 = disable paste, to enable paste text, enter value 0 (optional option)

Enjoy.