简体   繁体   English

访问键修饰符似乎不起作用

[英]Access key modifier doesn't seem to work

I have the following code:我有以下代码:

<div id="ftr_top_ctr-lft2">
<input type="button" title="Mark question" value="Mark" onclick="doCheck('process'); return false;" accesskey="M">
</div>

I tried to make it so there was a key users could use for quick access.我试图做到这一点,以便有一个关键用户可以用来快速访问。 But it seems like it doesn't work.但它似乎不起作用。 Am I missing something?我错过了什么吗? Also is there an easy way for me to tell the user how to use the access key (if it worked).还有一种简单的方法可以告诉用户如何使用访问密钥(如果有效)。

Maricel马里塞尔

Use利用

<ALT> + <AccessKey>   in Internet explorer.  

But in the Firefox you have to use但是在 Firefox 你必须使用

<ALT>+<SHIFT>+<AccesKey>  

It will work:-)它会工作:-)

Here is an Example for accesskeys..这是访问密钥的示例..

<html>
<body>
<input type="text" 
   size="40" 
   id="myButton" 
   accesskey="Z" 
   value="Press Alt + Z to bring me into focus">
<button onclick="myButton.accessKey='N';">Change Access Key to N</button>
</body>
</html>

To notify the user, add a label before or after the input with the notification text ("Press Alt-M").要通知用户,请在带有通知文本的输入之前或之后添加 label(“按 Alt-M”)。 Convention also says you can underline the character that should be pressed ("_M_ark").约定还说您可以在应该按下的字符下划线(“_M_ark”)。

To operate the access key, remember to use Alt.要操作访问键,请记住使用 Alt。

Label should help you. Label 应该可以帮助您。 Try this.尝试这个。

<html>

<body> 
    <label for="txtAccessKey" accesskey="M" >Press M to access the text box. </label>
    <input id="txtAccessKey" /> 
 </body> 
 </html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM