开发者

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开发者_JAVA百科 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

<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"). Convention also says you can underline the character that should be pressed ("_M_ark").

To operate the access key, remember to use Alt.


Label should help you. Try this.

<html>

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜