案例:javascript案例     状态:可编辑再运行    进入横版
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function removeWrapping()
5
{
6
document.getElementById("div1").style.whiteSpace="nowrap";
7
}
8
</script>
9
</head>
10
<body>
11
12
<div id="div1">
13
This is some text. This is some text. This is some text.
14
This is some text. This is some text. This is some text.
15
This is some text. This is some text. This is some text.
16
This is some text. This is some text. This is some text.
17
</div>
18
<br />
19
<input type="button" onclick="removeWrapping()" value="Do not let the text wrap" />
20
21
</body>
22
</html>
23

 运行结果 
 北美留学生论坛