【文件属性】:
文件名称:jquery字數限制
文件大小:593B
文件格式:JS
更新时间:2014-05-30 10:20:43
jquery limit
限制text 或textarea輸入字數
使用方式
$(":text").each(function(){
if($(this).attr("maxlength")<2147483647){
var obj = $('',{id:$(this).attr("name")+'_charsLeft'});
$(this).after("字").after(obj).after("還可輸入");
$(this).limit($(this).attr("maxlength"),"#"+obj.attr("id"));
}//if
});//each