如题所述
var text = document.getElementById('text');
text.oninput = function (event) {
var value = this.value;
if(value.length > 5) {
this.value = value.substring(0, value.length-1);
}
};
text.oninput = function (event) {
var value = this.value;
if(value.length > 5) {
this.value = value.substring(0, value.length-1);
}
};
å½ç¨æ·è¾å
¥å¤§äº5个åï¼ææ¬æ¡éé¢å°±ä¸è½å继ç»è¾å
¥äºã
温馨提示:答案为网友推荐,仅供参考