案例:javascript案例     状态:可编辑再运行    进入横版
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function changeLineHeight()
5
{
6
document.getElementById("div1").style.lineHeight="2";
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="changeLineHeight()" value="Change line-height" />
20
21
</body>
22
</html>
23

 运行结果 
 北美留学生论坛