counts the character entered into an input or textarea also limits the maximum characters
You can download the plugin from GitHub.
Inside the page's head tag include the char-count's CSS file.
<link rel="stylesheet" type="text/css" href="css/char-count.css" />
In the page's footer, just before, include the required JavaScript files.
<script src="js/char-count.min.js"></script>
<input id="my-input" />
<script type="text/javascript">
jQuery( document ).ready(function( $ ) {
$( '#my-input' ).char_count({
maxValue: 30,
showMaxValue: true,
background: "#34BC00",
hideOnBlur: false,
position: "top",
});
});
</script>
Demo.
If you found a bug or have a feature suggestion, please email me on [email protected]. If you need help with implementing the char-count in your project feel free to contact me on [email protected].
License The plugin is available under the MIT license.