I've also introduced a similar effect to the jquery plugin jquery maxlength text word limit plugin, but this time the charcount deployment is simpler and has the ability to exceed the number prompts.
Simple deployment:
1. Load js:
Copy Code code as follows:
<script type= "Text/javascript" src= "Js/jquery.js" ></script>
<script type= "Text/javascript" src= "Js/charcount.js" ></script>
2.Html Structure:
Copy Code code as follows:
<form id= "form" method= "POST" action= "" >
<div>
<label for= "message" >type your message</label>
<textarea id= "Message1" name= "Message1" ></textarea>
</div>
<div>
<label for= ' message ' >another message (limited-warning at) </label>
<textarea id= "Message2" name= "Message2" ></textarea>
</div>
</form>
3.charCount plug-in settings:
Copy Code code as follows:
<script type= "Text/javascript" >
$ (document). Ready (function () {
Default usage
$ ("#message1"). CharCount ();
Custom usage
$ ("#message2"). CharCount ({
Allowed:30,
Warning:10,
Countertext: ' The remaining words: '
});
});
</script>
Demo Code
Package Package Download