Set maxlength in Html Textarea [duplicate]
问题 This question already has answers here : How can I block further input in textarea using maxlength (5 answers) Closed 6 years ago . How can I set the maxlength in a textarea ? And why maxlength is not working properly in textarea ? 回答1: Before HTML5, we have an easy but workable way: Firstly set an maxlength attribute in the textarea element: <textarea maxlength='250' name=''></textarea> Then use JavaScript to limit user input: $(function() { $("textarea[maxlength]").bind('input