PHP
OOPs
JavaScript
JQuery
Ajax
Codeigniter
Laravel
MySql
Node.js
Tutorials
C
C++
Json
Codeigniter 4
htaccess
wordpress
react.js
Blogs
Fundamental
Python
Search Your Query
×
--- Select Category ---
PHP
OOPs
JavaScript
JQuery
Ajax
Codeigniter
Laravel
MySql
Node.js
Tutorials
Blogs
Fundamental
Python
Most Popular Tutorials
what is jquery
Document object model (DOM)
JQuery Syntax
jQuery Selectors
Get and set value in jquery
JQuery Attribute
Attribute Methods
jQuery - DOM Manipulation
Jquery events
JQuery Effects
Jquery Html/css Effects
jQuery Insert New Content
Auto hid Div
Jquery no conflict
JQuery Form validation
Html Form Validation
Login Form Validation
JQuery Fadeout Message
Jquery Modal popup
JQuery Ajax Form
Dynamic Dependent DropDown
Autocomplete list
Dynamic content load
Dynamic Star Rating
Drag and Drop Image Upload
show Hide Elements By click on checkbox
Add or Remove class in jquery
check Password strength
Count Remaining Character
check single or All checkboxes
Password match or not
Data Table
Date Picker
Multiselect Dropdown with Checkbox
Add Dynamic Input Field (Add More Input Field)
submit button disable after one click
Show hide password in Password textbox using checkbox
set content and value in html page
put value in the text field
sweet alert
Data-id
Most Popular Tutorials :-
Simply Easy Learning at Your Fingertips. Click Tutorials Menu to view More Tutorial List
Tutorials Menus (Click Here)
what is jquery
Document object model (DOM)
JQuery Syntax
jQuery Selectors
Get and set value in jquery
JQuery Attribute
Attribute Methods
jQuery - DOM Manipulation
Jquery events
JQuery Effects
Jquery Html/css Effects
jQuery Insert New Content
Auto hid Div
Jquery no conflict
JQuery Form validation
Html Form Validation
Login Form Validation
JQuery Fadeout Message
Jquery Modal popup
JQuery Ajax Form
Dynamic Dependent DropDown
Autocomplete list
Dynamic content load
Dynamic Star Rating
Drag and Drop Image Upload
show Hide Elements By click on checkbox
Add or Remove class in jquery
check Password strength
Count Remaining Character
check single or All checkboxes
Password match or not
Data Table
Date Picker
Multiselect Dropdown with Checkbox
Add Dynamic Input Field (Add More Input Field)
submit button disable after one click
Show hide password in Password textbox using checkbox
set content and value in html page
put value in the text field
sweet alert
Data-id
Share On Facebook
How to count remaining characters using jquery?
Count Remaining Character in jQuery
File name : index.php
<!Doctype html>
<html>
<head>
<title>Twitter Style Remaining Character Count using jQuery</title>
<style>
body{width:610px;}
#text-content{padding:10px; border:#F0F0F0 1px solid; border-radius:4px;background-color:#FFF;}
#text-content:focus{outline: 0;}
#character-count{color: #A0A0A0;padding: 15px 0px;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<textarea id="text-content" cols="70" rows="4" onKeyup="count_remaining_character()" placeholder="At least 100 character"></textarea>
<div id="character-count" align="right">150</div>
<script>
function count_remaining_character() {
var max_length = 100;
var character_entered = $('#text-content').val().length;
var character_remaining = max_length - character_entered;
$('#character-count').html(character_remaining);
if(max_length < character_entered) {
$('#character-count').css('color','#FF0000');
} else {
$('#character-count').css('color','#A0A0A0');
}
}
</script>
</body>
</html>
Output :-
Twitter Style Remaining Character Count using jQuery
150