[英]What's wrong with this simple code - Substring?
What's wrong in here? 这是怎么了
function setMaxLenght(textbox, length) {
var currentLength = textbox.value.length;
var minimum = Math.min(currentLength, length);
textbox.value = textbox.value.subString(0, minimum - 1);
}
When the code reaches the last line, it throws this error: 当代码到达最后一行时,它将引发此错误:
Uncaught type error: Object 1 has no method 'subString'
because there is no subString method. 因为没有subString方法。
It is all lowercase 都是小写的
textbox.value.substring(0
^
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.