案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function setFloat()
5
{
6
document.getElementById("img1").style.cssFloat="left";
7
}
8
</script>
9
</head>
10
<body>
11
12
<img id="img1" src="/img/ct_beatles.jpg" />
13
14
<p>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.</p>
17
18
<input type="button" onclick="setFloat()" value="Set image to float to the left" />
19
20
</body>
21
</html>
22