x
 
<html>
<head>
<script type="text/javascript">
function gettip(txt)
{
document.getElementById('tip').innerHTML=txt
}
function reset()
{
document.getElementById('tip').innerHTML=""
}
</script>
</head>
<body>
<p>把鼠标移动到下面的饮料上:</p>
<span onmouseover="gettip('热的黑色饮品')"
onmouseout="reset()">咖啡</span>
<br /><br />
<span onmouseover="gettip('冷的白色饮品')"
onmouseout="reset()">牛奶</span>
<p id="tip"></p>
</body>
</html>