Set Input max length with display character count jQuery Plugin – jQuery.maxlength.js

In this Post I am going to share small jQuery Plugin to set max length with display character count , default HTML input max length doesn’t display how many character are remaining and what is the maximum limit for any input box. This small plugin makes your input box more informative which display of maxlength and realtime character count.

Integrate jQuery.maxlength.js in Your HTML Input box


Include latest jQuery library with jQuery.maxlength.js

<script src="//"></script>
<script src="jQuery.maxlength.js"></script>


Put your input text fields inside DIV containers and specify the maximum number of characters using the native maxlength attribute or data-val-length attribute.

        <textarea maxlength="50" name="" id="" cols="30" rows="10"></textarea>


Finally call the plugin and it’ll make your text box informative as soon as user input character it’ll display realtime character count with max character allowed.

$(function() {   

See live demos and download source code.


Visit official github repository for more information and follow for future updates. Don’t forget to read license for using this plugin in your projects.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.