<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>热身</title>
</head>
<body>
<p id="p1">我是第一段文字</p>
<p id="p2">我是第二段文字</p>
<script type="text/javascript">
document.write("hello");
document.write("hello");
document.getElementById("p1").style.color="blue";
document.getElementById("p2").innerHTML+=',zejiazhang'
</script>
</body>
</html>
这里我输出两个hello,可是接在一起的,怎么输出换行
在hello后面添加一个br标签就可以了
document.write("hello"+"<br>");
document.write("hello"+'<br />+'hello');
document.write("hello<br/>hello");
document.write("hello"+"<br/>");
document.write("hello</br>world");
document.write("hello"+"<br>");