问题
accessKeyLabel from what I can tell is not supported in Webkit (but works fine in Firefox) at the time of writing. This snippet shows what happens:
<input type="text" accesskey="D" name="dog" id="dog">
var dogInput = document.getElementById('dog');
console.log(dogInput.accessKey);
// Firefox, Webkit both output: "D"
console.log(dogInput.accessKeyLabel);
// Firefox output: "[ACCESS MODIFIER] D"
// Webkit output: undefined
Is there another way of getting the access modifier combination or accessKeyLabel in Webkit?
回答1:
This is an unimplemented feature (known bug) in WebKit:
https://bugs.webkit.org/show_bug.cgi?id=72715
来源:https://stackoverflow.com/questions/16623329/how-to-get-accesskeylabel-in-webkit-with-javascript