Latest web development tutorials

Keygen autofocus attribute

Keygen Object Reference Keygen objects

Examples

See keygen field whether to automatically get the focus when the page loads:

var x = document.getElementById("myKeygen").autofocus;

x The output is:

true

try it"

Definitions and use

autofocus property sets or returns keygen field whether to automatically get focus when the page loads.

This attribute is HTML autofocus property.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the autofocus attribute, in addition to Internet Explorer.

Note: <keygen> element in HTML autofocus attribute does not support Firefox.


grammar

Back autofocus properties:

keygenObject .autofocus

Setting autofocus properties:

keygenObject .autofocus=true|false

Property Value

描述
true|false 描述了 keygen 字段在页面加载时是否获取焦点。
  • true - keygen 字段获取焦点
  • false - 默认。 keygen 字段不获取焦点

Technical Description

return value: Boolean value that, if the keygen field automatically get the focus when the page loads return tru, false otherwise


Related Pages

HTML Reference Manual: HTML <keygen> The autofocus attribute


Keygen Object Reference Keygen objects