All Implemented Interfaces:
TagBase, InputAttributable, Serializable, Cloneable

public class AutoFocus extends AbstractAttribute implements InputAttributable
autofocus attribute for the element.
This Boolean attribute lets you specify that a form control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form element in a document can have the autofocus attribute, which is a Boolean. It cannot be applied if the type attribute is set to hidden (that is, you cannot automatically set focus to a hidden control). Note that the focusing of the control may occur before the firing of the DOMContentLoaded event.
Since:
1.0.0
See Also:
  • Constructor Details

    • AutoFocus

      public AutoFocus()
    • AutoFocus

      public AutoFocus(String value)
  • Method Details

    • setValue

      public void setValue(String value)
    • setValue

      public void setValue(boolean updateClient, String value)
      sets the value for this attribute
      Parameters:
      updateClient - true to update client browser page if it is available. The default value is true but it will be ignored if there is no client browser page.
      value - the value for the attribute.
      Since:
      2.1.15
    • getValue

      public String getValue()
    • init

      protected void init()
      invokes only once per object
      Since:
      1.0.0