W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <style type="text/css"> a:active {color:green} </style> <script type="text/javascript"> function getfocus() {document.getElementById('myAnchor').focus()} function losefocus() {document.getElementById('myAnchor').blur()} </script> </head> <body> <a id="myAnchor" href="https://www.w3school.org.cn">访问 W3School.org.cn</a> <br /><br/> <input type="button" onclick="getfocus()" value="获得焦点"> <input type="button" onclick="losefocus()" value="失去焦点"> </body> </html>