<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
	
<script type="text/javascript">
    document.write("开始计算...");   //开始信号
	document.write("<br>")  ;    //换行
	//alert弹出的提示
	//document.write页面上显示
    var now1 =new Date();
    s1=now1.getTime();
    var s=0;
    for( var i=1;i<=10000;i++) {
       s+=i;
     }
    var now2 =new Date();
     s2=now2.getTime();
     document.write ("时间为:"+(s2-s1)+"ms");
</script>
</head>

<body>
</body>
</html>

document.write("<br>");只能用这个换行,\n不行

Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐