The accesskey attribute assign a keyboard shortcut to an element.
This attribute can be used in the following elements.
A, AREA, INPUT, TEXTAREA, BUTTON, LABEL, LEGEND
<a href="example.html" accesskey="y"> - </a>
| Attribute | Value | Explanation |
|---|---|---|
| accesskey=" " | character | arbitrary character |
Shortcut example
<a href="index.html" accesskey="m">Attributes (M)</a>
MSIE and Firefox (Windows) : Alt + Access key (M)
Opera (Windows) : Shift + Esc + Access key (M)
<form method="POST" action="example.cgi"> <p> URL(U) : <input type="text" name="url" accesskey="u"> </p> <p> Question : <input type="radio" name="q" value="yes" accesskey="y">Yes(Y) <input type="radio" name="q" value="no" accesskey="n">No(N) </p> <p> Comment(C) :<br> <textarea name="comment" cols="50" rows="5" accesskey="c"></textarea> </p> <p> <input type="submit" value="Submit(S)" accesskey="s"> <input type="reset" value="Reset(R)" accesskey="r"> </p> </form>
This form cannot submit because of a sample.