案例:HTML DOM案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
4
<script type="text/javascript">
5
function moveleft()
6
{
7
document.getElementById('header').style.position="absolute"
8
document.getElementById('header').style.left="0"
9
}
10
11
function moveback()
12
{
13
document.getElementById('header').style.position="relative"
14
}
15
</script>
16
</head>
17
<body>
18
19
<h1 id="header" 
20
onmouseover="moveleft()"
21
onmouseout="moveback()">
22
请把鼠标移动到文本上</h1>
23
24
</body>
25
</html>
26