案例:HTML DOM案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<style>
4
img
5
{
6
filter:gray()
7
}
8
</style>
9
10
<script type="text/javascript">
11
function color(elmnt)
12
{
13
elmnt.style.filter=false
14
}
15
16
function gray(elmnt)
17
{
18
elmnt.style.filter="gray()"
19
}
20
</script>
21
22
</head>
23
<body>
24
25
请把鼠标移动到图像链接上:
26
<p>
27
<a href="/img/eg_landscape.jpg">
28
<img border="0" onmouseover="color(this)" onmouseout="gray(this)" src="/img/eg_banner_W3xue100_35.gif" /><br /></a>
29
30
<a href="http://www.baidu.com/">
31
<img border="0" onmouseover="color(this)" onmouseout="gray(this)" src="/img/baidu_logo.png" /><br /></a>
32
33
<a href="http://www.so.com/">
34
<img border="0" onmouseover="color(this)" onmouseout="gray(this)" src="/img/360so_logo.png" /></a>
35
</p>
36
37
</body>
38
</html>