Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to limit character input in the textarea including count using Jquery

by
Category:javascript
javascript jquery html
How to limit character input in the textarea including count using Jquery

I will explain how to use jQuery to limit number of characters in textarea(textbox) even copy and paste text or jQuery restrict textbox(textarea) length even copy and paste text in textbox show below code. You may also like How to count same value in array using php and How to count same value comma separated string in php.

HTML Code

<textarea class="checkLimit" maxlength="100"></textarea>
<span id="count">100</span> Remaining Character

Jquery Code

<script language="javascript" type="text/javascript">
    var maxLength = 100;
    $('.checkLimit').keyup(function() {
      var textlen = maxLength - $(this).val().length;
      $('#count').text(textlen);
    });
</script>

0 Comments


Html code work in comment box


Related Post