//輸入計數
//count:能輸入的數據總量 function Calculation(v, count) { var span = $(v).next(); var valLength = $(v).val().length; if (valLength > count) { $(v).val($(v).val().substr(0, count)); valLength = count; } span.text("您已輸入" + valLength + "字元,還剩下" + (count - valLength) + "字元"); }
新闻热点
疑难解答