问答详情
源自:7-9 字符串分割split()

浏览器没显示,也不报错

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>无标题文档</title>

<script type="text/javascript">

var mystr="86-010-85468578";

document.write(mystr.split("-")+ "<br>");

document.write(mystr.split("") + "<br>");

document.write(mystr.split("", 3);

</script>

</head>

<body>

</body>

</html>


提问者:Brilliant8866 2021-08-05 16:58

个回答

  • 慕斯卡5523246
    2021-08-27 21:27:06

    <!DOCTYPE HTML>

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <title>无标题文档</title>

    <script type="text/javascript">

    var mystr="86-010-85468578";

    document.write(mystr.split("-")+ "<br>");

    document.write(mystr.split("") + "<br>");

    document.write(mystr.split("", 3)); //<---这里少了个后括号

    </script>

    </head>

    <body>

    </body>

    </html>


  • qq_慕姐5514859
    2021-08-13 15:03:06

    document.write(mystr.split("", 3);你这句的括号呢??