开发者

Javascript field value length [closed]

开发者 https://www.devze.com 2022-12-27 22:15 出处:网络
开发者_StackOverflow This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is
开发者_StackOverflow This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

I'm doing something like this:

alert(document.getElementById('cardNumber').value);

And it alerts cardNumber value. But I need in its length:

alert(document.getElementById('cardNumber').value.lenght);

undefined

Why?


It's because the word is spelled 'length'.

0

精彩评论

暂无评论...
验证码 换一张
取 消