JavaScript 参考手册
HTML DOM accessKey 属性
下面的例子可返回单选按钮的快捷键
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> <script> function accesskey() { document.getElementById('m').accessKey = "m" document.getElementById('g').accessKey = "g" } </script> </head> <body onload="accesskey()"> <a id="m" href="https://www.mifengjc.com/">Mifengjc</a><br> <a id="g" href="http://www.google.com/">Google</a> <p><b>注:</b>使用Alt + <i> accesskey </i>访问具有指定访问键的元素。</p> </body> </html>
运行结果:
点击运行 »