img accesskey attribute
The accesskey attribute on the img element:
- allows you to focus or activate an image through a keyboard key
- is a global attribute → can be applied on all html elements;
- when applied on the root element <html>,its value is inherited by all other html elements
Examples
<img | attribute | = | "value(s)" | > | Examples | ||
---|---|---|---|---|---|---|---|
1. | accesskey | = | keyboard key | <src=".." alt="alt text" accesskey="i"> |
Video demonstration accesskey attribute on img
HTML5 img accesskey attribute Tutorial
min | video details |
---|---|
00:02 | video tutorial: accesskey attribute on img |
00:04 | the accesskey attribute on img allows you to focus or activate that image through a keyboard key |
00:17 | in Firefox,Windows the key combination that activates the image is: Alt+Shift+accesskey which is in our case "i" the key combination is different function of Browser and OS |
00:22 | it means that the function "openw()" will execute when: - clicking on the image OR - when pressing: Alt+Shift+i (if Firefox on Windows) |
00:31 | test: clicking on the image: result ok |
00:39 | testing the accesskey: Alt+Shift+i |
00:41 | test result ok: the function was executed → the image was activated (focused) through i keyboard key |