摘要: 解决方法: //作用于整个html中 function check(form) { //topic是input的id,descrip是textarea的id var topic = $("#topic").val().length; var descrip = $("#descrip").val() 阅读全文
posted @ 2016-03-02 23:11 我大沈阳无敌 阅读(438) 评论(0) 推荐(0) 编辑
摘要: 解决办法: 在开发中,多少会遇到一些界面,输入限制字数。 例如: //页面加载完毕 $(function() { //descrip是textarea的id $("#descrip").on('input',function(event) { //实时改变span的数值 descrip_lenth是 阅读全文
posted @ 2016-03-02 23:02 我大沈阳无敌 阅读(1516) 评论(0) 推荐(0) 编辑
摘要: 解决办法: #descrip 是textarea的id,字数小于40; $("#descrip").on('input',function(event) { if ($("#descrip").val().length >= 40) { $("#descrip").val($("#descrip") 阅读全文
posted @ 2016-03-02 22:12 我大沈阳无敌 阅读(655) 评论(0) 推荐(0) 编辑