两者都没有使用哪些键盘快捷键:Chrome和Firefox?

时间:2014-03-15 11:29:43

标签: javascript google-chrome firefox

我在网站上使用键盘快捷键。似乎Firefox和Chrome使用类似的。两种浏览器都可以免费使用哪些键盘快捷键?例如ALT + G

1 个答案:

答案 0 :(得分:1)

最好的方法是尝试一下!

请注意,每个浏览器都有自己的accesskeys版本(适用于Windows) 有关详细信息,请参阅:https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes

  • Chrome: ALT +
  • Firefox: ALT + SHIFT + key
  • Internet Explorer: ALT + key
  • Opera: SHIFT + ESC ...(对话框)(据说......但我无法上班)
  • Safari: ALT + key

使用下面的代码......这是我的测试结果:

  • Firefox:所有A-Z,0-9键都可用
  • Chrome:A-C,_,_,_,G-Z,0-9(D聚焦位置栏,E& F打开"汉堡"菜单)
  • Internet Explorer:A-C,_,E-Z,0-9(D聚焦位置栏)

这在Mac上可能略有不同(我还没有测试过)

<!doctype html>
<html>
 <head>
  <title>Access Key Test</title>
</head>
<body>
  <form name="test">
    <input type="button" value="A" accesskey="A" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="B" accesskey="B" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="C" accesskey="C" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="D" accesskey="D" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="E" accesskey="E" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="F" accesskey="F" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="G" accesskey="G" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="H" accesskey="H" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="I" accesskey="I" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="J" accesskey="J" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="K" accesskey="K" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="L" accesskey="L" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="M" accesskey="M" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="N" accesskey="N" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="O" accesskey="O" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="P" accesskey="P" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="Q" accesskey="Q" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="R" accesskey="R" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="S" accesskey="S" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="T" accesskey="T" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="U" accesskey="U" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="V" accesskey="V" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="W" accesskey="W" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="X" accesskey="X" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="Y" accesskey="Y" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="Z" accesskey="Z" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="0" accesskey="0" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="1" accesskey="1" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="2" accesskey="2" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="3" accesskey="3" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="4" accesskey="4" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="5" accesskey="5" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="6" accesskey="6" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="7" accesskey="7" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="8" accesskey="8" onclick="console.log(this.value);alert(this.value);"/>
    <input type="button" value="9" accesskey="9" onclick="console.log(this.value);alert(this.value);"/>
  </form>
</body>
</html>