Jquery Tutorials
- What is JQuery
- DOM Document Object Model
- JQuery Syntax
- Jquery Selector
- Get & Set Form value
- jQuery - Attributes
- Attribute Methods
- jQuery - DOM Manipulation
- JQuery Events
- JQuery Effects
- JQuery Html/Css
- jQuery Insert Content
- Auto Hide Div
- JQuery noConflict()
- JQuery Form Validation
- Form Validation
- Login Form Validation
- Jquery Fadeout message
- Modal popup
- Jquery Ajax Forms
- Dependent Dropdown
- Autocomplete Country jquery ajax
- Dynamic Content Load using jQuery AJAX
- Dynamic star rating jQuery AJAX
- Drag and Drop Image Upload
- show Hide Elements By click on checkbox
- How to Add class in jQuery
- calculate discount in jQuery
- Calculate GST by input value in text box
- check Password strength in jQuery
- Count Remaining Character
- onClick Checkbox check all
- password match or not
- DataTable
- 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
- Put value in the text field
- Set Data and Attributes
Customer Say
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 :-
150