This jQuery plugin retrieves the keys that activate the access-key of the HTML elements which have it defined.
It currently supports Linux, Mac and Windows OS and Chrome, Firefox, Opera and IE. It uses some of the mapping info from https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
Requires jQuery >=1.5 and https://github.com/bestiejs/platform.js/blob/master/platform.js
-
Include jQuery & platform.js:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/platform/1.3.5/platform.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
-
Include plugin's code:
<script type="text/javascript" src="../Jquery.accessKeysActivators.js"></script>
-
Call the plugin:
$(function() { var keys = $.getAccessKeyActivators(); console.log(keys); $("div").html(keys.toString()); });
Follow the instructions in https://github.com/jquery-boilerplate/jquery-boilerplate/wiki/How-to-publish-a-plugin-in-jQuery-Plugin-Registry