浏览器没显示,也不报错

来源:7-9 字符串分割split()

Brilliant8866

2021-08-05 16:58

<!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>


写回答 关注

2回答

  • 慕斯卡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);你这句的括号呢??

JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

468061 学习 · 21891 问题

查看课程

相似问题