HTML DOM accessKey 属性
定义和用法
accessKey 属性可设置或返回访问单选按钮的快捷键。
注释:请使用 Alt + accessKey 为拥有指定快捷键的元素赋予焦点。
语法
radioObject.accessKey=accesskey
实例
下面的例子可返回单选按钮的快捷键:
<html> <body> <form> Male: <input id="male" accesskey="m" type="radio" name="Sex" value="Male" /> <br /> Female: <input id="female" accesskey="f" type="radio" name="Sex" value="Female" /> </form> <p>The access key for the radio buttons are: <script type="text/javascript"> document.write(document.getElementById('male').accessKey
); document.write(" and "); document.write(document.getElementById('female').accessKey
); </script></p> </body> </html>