<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript"> <br>function words_deal() <br>{ <br>var curLength=$("#TextArea1").val().length; <br>if(curLength>5) <br>{ <br>var num=$("#TextArea1").val().substr(0,5); <br>$("#TextArea1").val(num); <br>alert("超过字数限制,多出的字将被截断!" ); <br>} <br>else <br>{ <br>$("#textCount").text(5-$("#TextArea1").val().length); <br>} <br>} <br></script>
剩余5个字









