W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <script> function bigImg(x) { x.style.height = "150px"; x.style.width = "150px"; } function normalImg(x) { x.style.height = "50px"; x.style.width = "50px"; } </script> </head> <body> <img onmouseover="bigImg(this)" onmouseout="normalImg(this)" border="0" src="/i/eg_smile.gif" alt="Smiley" width="128" height="128"> <p>当用户将鼠标指针移到图像上时,会触发 bigImg() 函数。</p> <p>当鼠标指针移出图像时,会触发 normalImg() 函数。</p> </body> </html>