javascript如何換行輸出呢?如下
<!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,可是接在一起的,怎么輸出換行
2016-04-23
在hello后面添加一個br標簽就可以了
2016-04-24
document.write("hello"+'<br />+'hello');
2016-04-24
?document.write("hello<br/>hello");
2016-04-24
document.write("hello"+"<br/>");
2016-04-24
document.write("hello</br>world");
2016-04-24
document.write("hello"+"<br>");