JavaScript String 對(duì)象
String的length屬性返回一個(gè)字符串的長度。對(duì)于空字符串,長度為0。
string.length
var str = 'cainiaoplus.com'; str.length;
所有瀏覽器完全支持length屬性: