Js控制输入字符数限制
From: http://www.phpcake.cn/archives/26/
- <script type="text/javascript">
- function ismaxlength(obj){
- var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
- if (obj.getAttribute && obj.value.length>mlength)
- obj.value=obj.value.substring(0,mlength)
- }
- </script>
- <textarea maxlength="10" onkeyup="return ismaxlength(this)"></textarea>
相关日志
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments
还没有评论。
发表评论