相关文章:

JavaScript String.length 属性详解

代码类型:

杂项:

  • 启用CSS/JS语法检查
  • 监测脚本运行错误
  • 禁止库文件重复

文档类型:

JS库文件:

手动添加:

     
    1
    xxxxxxxxxx
    15
     
    1
    //在当前页面内追加换行标签和指定的HTML内容
    2
    function w( html ){
    3
        document.body.innerHTML += "<br/>" + html;
    4
    }
    5
    6
    7
    8
    var str = "张三";
    9
    w( str.length ); // 2
    10
    11
    str = "CodePlayer";
    12
    w( str.length ); // 10
    13
    14
    str = "";
    15
    w( str.length ); // 0
    xxxxxxxxxx
    1
     
    1