W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<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>