专注前端素材!
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>素材8网教程(study.sucai8.cn)</title> <script> function accesskey(){ document.getElementById('w3s').accessKey="w" document.getElementById('g').accessKey="g" } </script> </head> <body onload="accesskey()"> <a id="w3s" href="http://www.w3cschool.cc/">W3Cschool</a><br> <a id="g" href="http://www.google.com/">Google</a> <p><b>注:</b>使用Alt + <i> accesskey </i>访问具有指定访问键的元素。</p> </body> </html>
运行结果