passer1991

js控制文本框中的字符数

function checkLength(which,remainderNum,maxChars) {
    if (which.value.length > maxChars)
        which.value = which.value.substring(0,maxChars);
    var curr = maxChars - which.value.length;
    document.getElementById(remainderNum).innerHTML = curr.toString();
}

 

posted on 2013-08-17 12:03  passer1991  阅读(174)  评论(0编辑  收藏  举报

导航