virtualkeyboardpolicy

The virtualkeyboardpolicy attribute in HTML controls the behavior of virtual keyboards on mobile devices, determining when they should appear for input fields.

virtualkeyboardpolicy attribute

The virtualkeyboardpolicy attribute regulates the behavior of the virtual keyboard for input fields, determining whether it should be displayed or hidden for specific elements.

Syntax

index.html
<input virtualkeyboardpolicy="value">

Usage Example

index.html
<input virtualkeyboardpolicy="manual" type="text" name="example">

Values

  • auto: The default setting; the virtual keyboard displays automatically when needed.
  • manual: The virtual keyboard is controlled manually and may not appear by default.
This attribute is not widely supported and is primarily used in specialized environments or devices.

See also

  • All global attribute.
  • HTMLElement.contentEditable and HTMLElement.isContentEditable

Conclusion

The virtualkeyboardpolicy attribute controls when the virtual keyboard appears on mobile devices for input fields. It offers two values: auto for automatic display and manual for manual control. This attribute is not widely supported and is mainly used in specialized environments.