以下是引用片段
/*
value: 值
byteLength
title
attribute
使用方法說明
添加 (
(
注意
例子
或
<input type=
*/
function limitLength(value
var newvalue = value
var length = newvalue
//當填寫的字節數小於設置的字節數
if (length *
return;
}
var limitDate = newvalue
var count =
var limitvalue =
for (var i =
var flat = limitDate
if (flat ==
count++;
}
}
var size =
var istar = newvalue
//if 基點是×; 判斷在基點內有×為偶數還是奇數
if (count %
//當為偶數時
size = count /
limitvalue = value
} else {
//當為奇數時
size = (count
limitvalue = value
}
alert(title +
document
return;
}
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20704.html