【发布时间】:2015-07-20 20:02:59
【问题描述】:
我在我的 HTML 文件的脚本部分中使用了 innerHTML。
document.getElementById("id1").innerHTML="<font size=4 color=blue><b>Process</b></font><br>"
如果它适合单行,它工作得很好, 但是我想在innerHTML中放置多行HTML代码,可以吗?
document.getElementById("demo").innerHTML = "
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CPU Information
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
No of Cores:
1
Speed of each core in Mhz:
cpu MHz : 2399.318
model name : Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
CPU Load:
0.1
Top CPU using process/application
-------------------------------------
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 15 0 10364 680 576 S 0.0 0.0 0:05.46 init
";
【问题讨论】:
标签: javascript html innerhtml