W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <script type="text/javascript"> function shakeleft() { document.getElementById('myLink').style.position="relative" document.getElementById('myLink').style.left="3" timer=setTimeout("shakeright()",10) } function shakeright() { document.getElementById('myLink').style.left="0" timer=setTimeout("shakeleft()",10) } function stoptimer() { clearTimeout(timer) } </script> </head> <body> <a id="myLink" href="https://www.w3school.org.cn/" onmouseover="shakeleft()" onmouseout="stoptimer()">请把鼠标移动到链接上</a> </body> </html>