<!DOCTYPE html>
<html>
<body>

Encryption: <keygen id="myKeygen" name="security" autofocus>

<p>Click the button to find out if the keygen field automatically gets focus when the page loads.</p>

<button onclick="myFunction()">Try it</button>

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

<script>
function myFunction() {
    var x = document.getElementById("myKeygen").autofocus;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>