源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> <script> function writeText(txt){ document.getElementById("desc").innerHTML=txt; } </script> </head> <body> /images/logo.png <map name="planetmap"> <area shape ="rect" coords ="0,0,82,126" onmouseover="writeText('太陽和氣體巨星類似木星是太陽系中最大的物體。')" href ="sun.htm" target ="_blank" alt="Sun" /> <area shape ="circle" coords ="90,58,3" onmouseover="writeText('從地球上很難研究水星,因為它太接近太陽。')" href ="mercur.htm" target ="_blank" alt="Mercury" /> <area shape ="circle" coords ="124,58,8" onmouseover="writeText('至到1960年,金星經常被認為是地球的孿生妹妹,因為金星是最靠近我們的行星,併且兩個行星有很多相似的特點。')" t')" href ="venus.htm" target ="_blank" alt="Venus" /> </map> <p id="desc">鼠標在太陽和星星上移動,可以看到不同的描述。</p> </body> </html>
運行結果