Element accessKey Property - Get the accesskey of a link: - Javascript DOM

Javascript examples for DOM:Element accessKey

Description

Element accessKey Property - Get the accesskey of a link:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<a id="myId" accesskey="w" href="https://www.java2s.com/">java2s.com</a>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//  w ww .j a  v  a 2  s . co m
    var x = document.getElementById("myId").accessKey;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials