案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function setSpace()
5
  {
6
  document.getElementById("compman").hspace="50"
7
  document.getElementById("compman").vspace="50"
8
  }
9
</script>
10
</head>
11
<body>
12
13
<img id="compman" src="/img/eg_compman.gif" alt="Computerman" align="right" />
14
<p>Some text. Some text. Some text. Some text.</p>
15
<input type="button" onclick="setSpace()" value="Set hspace and vspace">
16
17
</body>
18
</html>
19