fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <style> a:focus, a:active { color: green; } </style> </head> <body> <a id="myAnchor" href="http://www.fmpq.com">访问Fmpq教程</a> <p>点击按钮设置或移除以上链接的焦点。</p> <input type="button" onclick="getfocus()" value="获取焦点"> <input type="button" onclick="losefocus()" value="移除焦点"> <script> function getfocus() { document.getElementById("myAnchor").focus(); } function losefocus() { document.getElementById("myAnchor").blur(); } </script> </body> </html>
运行结果