实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script>
5
function writeText(txt)
6
{
7
document.getElementById("desc").innerHTML=txt;
8
}
9
</script>
10
</head>
11
12
<body>
13
<img src ="/upload/love/html.gif" width ="145" height ="126" alt="Planets" usemap="#planetmap" />
14
15
<map name="planetmap">
16
<area shape ="rect" coords ="0,0,82,126"
17
onmouseover="writeText('The Sun and the gas giant planets like Jupiter are by far the largest objects in our Solar System.')"
18
href ="sun.htm" target ="_blank" alt="Sun" />
19
20
<area shape ="circle" coords ="90,58,3"
21
onmouseover="writeText('The planet Mercury is very difficult to study from the Earth because it is always so close to the Sun.')"
22
href ="mercur.htm" target ="_blank" alt="Mercury" />
23
24
<area shape ="circle" coords ="124,58,8"
25
onmouseover="writeText('Until the 1960s, Venus was often considered a twin sister to the Earth because Venus is the nearest planet to us, and because the two planets seem to share many characteristics.')"
26
href ="venus.htm" target ="_blank" alt="Venus" />
27
</map> 
28
29
<p id="desc">Mouse over the sun and the planets and see the different descriptions.</p>
30
31
</body>
32
</html>
33
34
35