Class Option


@Bean(typeName="option") public class Option extends HtmlElementText
DTO for an HTML <option> element.

The option element represents an option in a select element or a suggestion in a datalist element. It defines a choice that users can select from a dropdown menu or autocomplete list. The value attribute specifies the value to be submitted, while the text content provides the display text.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple option Option option1 = option("red", "Red"); // Selected option Option option2 = option("blue", "Blue") .selected(true); // Disabled option Option option3 = option("gray", "Gray") .disabled(true); // Option with label Option option4 = option("green", "Green") .label("Green Color"); // Options in a select Select select1 = select("color", option("red", "Red"), option("green", "Green"), option("blue", "Blue") );

The following convenience methods are provided for constructing instances of this bean:

See Also:
  • Constructor Details

  • Method Details

    • _class

      public Option _class(String value)
      Description copied from class: HtmlElement
      class attribute.

      Specifies one or more CSS class names for the element, separated by spaces. These classes can be used for styling and JavaScript selection.

      Overrides:
      _class in class HtmlElementText
      Parameters:
      value - Space-separated CSS class names (e.g., "btn btn-primary").
      Returns:
      This object.
    • accesskey

      public Option accesskey(String value)
      Description copied from class: HtmlElement
      accesskey attribute.

      Defines a keyboard shortcut to activate or focus an element. The value should be a single character that, when pressed with a modifier key (usually Alt), activates the element.

      Overrides:
      accesskey in class HtmlElementText
      Parameters:
      value - The keyboard shortcut character (e.g., "a", "1").
      Returns:
      This object.
    • attr

      public Option attr(String key, Object val)
      Description copied from class: HtmlElement
      Adds an arbitrary attribute to this element.
      Overrides:
      attr in class HtmlElementText
      Parameters:
      key - The attribute name.
      val - The attribute value.
      Returns:
      This object.
    • attrUri

      public Option attrUri(String key, Object val)
      Description copied from class: HtmlElement
      Adds an arbitrary URI attribute to this element.

      Same as HtmlElement.attr(String, Object), except if the value is a string that appears to be a URI (e.g. "servlet:/xxx").

      The value can be of any of the following types: URI, URL, String. Strings must be valid URIs.

      URIs defined by UriResolver can be used for values.

      Overrides:
      attrUri in class HtmlElementText
      Parameters:
      key - The attribute name.
      val - The attribute value.
      Returns:
      This object.
    • contenteditable

      public Option contenteditable(Object value)
      Description copied from class: HtmlElement
      contenteditable attribute.

      Indicates whether the element's content is editable by the user.

      Possible values:

      • "true" or empty string - Element content is editable
      • "false" - Element content is not editable
      • "plaintext-only" - Element content is editable, but rich text formatting is disabled
      Overrides:
      contenteditable in class HtmlElementText
      Parameters:
      value - The editability state of the element.
      Returns:
      This object.
    • dir

      public Option dir(String value)
      Description copied from class: HtmlElement
      dir attribute.

      Specifies the text direction of the element's content.

      Possible values:

      • "ltr" - Left-to-right text direction
      • "rtl" - Right-to-left text direction
      • "auto" - Browser determines direction based on content
      Overrides:
      dir in class HtmlElementText
      Parameters:
      value - The text direction for the element.
      Returns:
      This object.
    • disabled

      public Option disabled(Object value)
      disabled attribute.

      Whether the form control is disabled.

      This attribute uses deminimized values:

      • false - Attribute is not added
      • true - Attribute is added as "disabled"
      • Other values - Passed through as-is
      Parameters:
      value - The new value for this attribute. Typically a Boolean or String.
      Returns:
      This object.
    • hidden

      public Option hidden(Object value)
      Description copied from class: HtmlElement
      hidden attribute.

      This attribute uses deminimized values:

      • false - Attribute is not added
      • true - Attribute is added as "hidden"
      • Other values - Passed through as-is
      Overrides:
      hidden in class HtmlElementText
      Parameters:
      value - The new value for this attribute. Typically a Boolean or String.
      Returns:
      This object.
    • id

      public Option id(String value)
      Description copied from class: HtmlElement
      id attribute.

      Specifies a unique identifier for the element. The ID must be unique within the document and can be used for CSS styling, JavaScript selection, and anchor links.

      Overrides:
      id in class HtmlElementText
      Parameters:
      value - A unique identifier for the element (e.g., "header", "main-content").
      Returns:
      This object.
    • label

      public Option label(String value)
      label attribute.

      Specifies the user-visible label for the option. This label is displayed in the select element and can be different from the option's value.

      The label should be user-friendly and descriptive of what the option represents.

      Parameters:
      value - The user-visible label for the option.
      Returns:
      This object.
    • lang

      public Option lang(String value)
      Description copied from class: HtmlElement
      lang attribute.

      Specifies the primary language of the element's content using a language tag. This helps with accessibility, search engines, and browser features like spell checking.

      Overrides:
      lang in class HtmlElementText
      Parameters:
      value - A language tag (e.g., "en", "en-US", "es", "fr-CA").
      Returns:
      This object.
    • onabort

      public Option onabort(String value)
      Description copied from class: HtmlElement
      onabort attribute.

      Event handler for when an operation is aborted (e.g., image loading is cancelled).

      Overrides:
      onabort in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the abort event occurs.
      Returns:
      This object.
    • onblur

      public Option onblur(String value)
      Description copied from class: HtmlElement
      onblur attribute.

      Event handler for when the element loses focus.

      Note:

      If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:

      • If using single quotes for attributes: onblur("validate(\"email\")")
      • If using double quotes for attributes: onblur("validate('email')")
      Overrides:
      onblur in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the element loses focus.
      Returns:
      This object.
    • oncancel

      public Option oncancel(String value)
      Description copied from class: HtmlElement
      oncancel attribute.

      Event handler for when a dialog is cancelled.

      Overrides:
      oncancel in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the cancel event occurs.
      Returns:
      This object.
    • oncanplay

      public Option oncanplay(String value)
      Description copied from class: HtmlElement
      oncanplay attribute.

      Event handler for when the media can start playing (enough data has been buffered).

      Overrides:
      oncanplay in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the canplay event occurs.
      Returns:
      This object.
    • oncanplaythrough

      public Option oncanplaythrough(String value)
      Description copied from class: HtmlElement
      oncanplaythrough attribute.

      Event handler for when the media can play through to the end without buffering.

      Overrides:
      oncanplaythrough in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the canplaythrough event occurs.
      Returns:
      This object.
    • onchange

      public Option onchange(String value)
      Description copied from class: HtmlElement
      onchange attribute.

      Event handler for when the value of a form element changes and loses focus.

      Note:

      If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:

      • If using single quotes for attributes: onchange("validate(\"field\")")
      • If using double quotes for attributes: onchange("validate('field')")
      Overrides:
      onchange in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the change event occurs.
      Returns:
      This object.
    • onclick

      public Option onclick(String value)
      Description copied from class: HtmlElement
      onclick attribute.

      Event handler for when the element is clicked.

      Note:

      If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:

      • If using single quotes for attributes: onclick("alert(\"Hello\")")
      • If using double quotes for attributes: onclick("alert('Hello')")
      Overrides:
      onclick in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the click event occurs.
      Returns:
      This object.
    • oncuechange

      public Option oncuechange(String value)
      Description copied from class: HtmlElement
      oncuechange attribute.

      Event handler for when a text track cue changes.

      Overrides:
      oncuechange in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the cuechange event occurs.
      Returns:
      This object.
    • ondblclick

      public Option ondblclick(String value)
      Description copied from class: HtmlElement
      ondblclick attribute.

      Event handler for when the element is double-clicked.

      Overrides:
      ondblclick in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the dblclick event occurs.
      Returns:
      This object.
    • ondurationchange

      public Option ondurationchange(String value)
      Description copied from class: HtmlElement
      ondurationchange attribute.

      Event handler for when the duration of the media changes.

      Overrides:
      ondurationchange in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the durationchange event occurs.
      Returns:
      This object.
    • onemptied

      public Option onemptied(String value)
      Description copied from class: HtmlElement
      onemptied attribute.

      Event handler for when the media element becomes empty (e.g., network error).

      Overrides:
      onemptied in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the emptied event occurs.
      Returns:
      This object.
    • onended

      public Option onended(String value)
      Description copied from class: HtmlElement
      onended attribute.

      Event handler for when the media playback reaches the end.

      Overrides:
      onended in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the ended event occurs.
      Returns:
      This object.
    • onerror

      public Option onerror(String value)
      Description copied from class: HtmlElement
      onerror attribute.

      Event handler for when an error occurs (e.g., failed resource loading).

      Overrides:
      onerror in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the error event occurs.
      Returns:
      This object.
    • onfocus

      public Option onfocus(String value)
      Description copied from class: HtmlElement
      onfocus attribute.

      Event handler for when the element receives focus.

      Note:

      If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:

      • If using single quotes for attributes: onfocus("highlight(\"field\")")
      • If using double quotes for attributes: onfocus("highlight('field')")
      Overrides:
      onfocus in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the focus event occurs.
      Returns:
      This object.
    • oninput

      public Option oninput(String value)
      Description copied from class: HtmlElement
      oninput attribute.

      Event handler for when the value of an input element changes (fires on every keystroke).

      Overrides:
      oninput in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the input event occurs.
      Returns:
      This object.
    • oninvalid

      public Option oninvalid(String value)
      Description copied from class: HtmlElement
      oninvalid attribute.

      Event handler for when form validation fails.

      Overrides:
      oninvalid in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the invalid event occurs.
      Returns:
      This object.
    • onkeydown

      public Option onkeydown(String value)
      Description copied from class: HtmlElement
      onkeydown attribute.

      Event handler for when a key is pressed down.

      Overrides:
      onkeydown in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the keydown event occurs.
      Returns:
      This object.
    • onkeypress

      public Option onkeypress(String value)
      Description copied from class: HtmlElement
      onkeypress attribute.

      Event handler for when a key is pressed (deprecated, use onkeydown instead).

      Overrides:
      onkeypress in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the keypress event occurs.
      Returns:
      This object.
    • onkeyup

      public Option onkeyup(String value)
      Description copied from class: HtmlElement
      onkeyup attribute.

      Event handler for when a key is released.

      Overrides:
      onkeyup in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the keyup event occurs.
      Returns:
      This object.
    • onload

      public Option onload(String value)
      Description copied from class: HtmlElement
      onload attribute.

      Event handler for when the element and its resources have finished loading.

      Note:

      If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:

      • If using single quotes for attributes: onload("init(\"config\")")
      • If using double quotes for attributes: onload("init('config')")
      Overrides:
      onload in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the load event occurs.
      Returns:
      This object.
    • onloadeddata

      public Option onloadeddata(String value)
      Description copied from class: HtmlElement
      onloadeddata attribute.

      Event handler for when the first frame of media has finished loading.

      Overrides:
      onloadeddata in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the loadeddata event occurs.
      Returns:
      This object.
    • onloadedmetadata

      public Option onloadedmetadata(String value)
      Description copied from class: HtmlElement
      onloadedmetadata attribute.

      Event handler for when metadata (duration, dimensions, etc.) has been loaded.

      Overrides:
      onloadedmetadata in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the loadedmetadata event occurs.
      Returns:
      This object.
    • onloadstart

      public Option onloadstart(String value)
      Description copied from class: HtmlElement
      onloadstart attribute.

      Event handler for when the browser starts loading the media.

      Overrides:
      onloadstart in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the loadstart event occurs.
      Returns:
      This object.
    • onmousedown

      public Option onmousedown(String value)
      Description copied from class: HtmlElement
      onmousedown attribute.

      Event handler for when a mouse button is pressed down on the element.

      Overrides:
      onmousedown in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the mousedown event occurs.
      Returns:
      This object.
    • onmouseenter

      public Option onmouseenter(String value)
      Description copied from class: HtmlElement
      onmouseenter attribute.

      Event handler for when the mouse pointer enters the element (does not bubble).

      Overrides:
      onmouseenter in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the mouseenter event occurs.
      Returns:
      This object.
    • onmouseleave

      public Option onmouseleave(String value)
      Description copied from class: HtmlElement
      onmouseleave attribute.

      Event handler for when the mouse pointer leaves the element (does not bubble).

      Overrides:
      onmouseleave in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the mouseleave event occurs.
      Returns:
      This object.
    • onmousemove

      public Option onmousemove(String value)
      Description copied from class: HtmlElement
      onmousemove attribute.

      Event handler for when the mouse pointer moves over the element.

      Overrides:
      onmousemove in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the mousemove event occurs.
      Returns:
      This object.
    • onmouseout

      public Option onmouseout(String value)
      Description copied from class: HtmlElement
      onmouseout attribute.

      Event handler for when the mouse pointer moves out of the element (bubbles).

      Overrides:
      onmouseout in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the mouseout event occurs.
      Returns:
      This object.
    • onmouseover

      public Option onmouseover(String value)
      Description copied from class: HtmlElement
      onmouseover attribute.

      Event handler for when the mouse pointer moves over the element (bubbles).

      Note:

      If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:

      • If using single quotes for attributes: onmouseover("showTooltip(\"info\")")
      • If using double quotes for attributes: onmouseover("showTooltip('info')")
      Overrides:
      onmouseover in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the mouseover event occurs.
      Returns:
      This object.
    • onmouseup

      public Option onmouseup(String value)
      Description copied from class: HtmlElement
      onmouseup attribute.

      Event handler for when a mouse button is released over the element.

      Overrides:
      onmouseup in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the mouseup event occurs.
      Returns:
      This object.
    • onmousewheel

      public Option onmousewheel(String value)
      Description copied from class: HtmlElement
      onmousewheel attribute.

      Event handler for when the mouse wheel is rotated over the element (deprecated, use onwheel).

      Overrides:
      onmousewheel in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the mousewheel event occurs.
      Returns:
      This object.
    • onpause

      public Option onpause(String value)
      Description copied from class: HtmlElement
      onpause attribute.

      Event handler for when media playback is paused.

      Overrides:
      onpause in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the pause event occurs.
      Returns:
      This object.
    • onplay

      public Option onplay(String value)
      Description copied from class: HtmlElement
      onplay attribute.

      Event handler for when media playback starts.

      Overrides:
      onplay in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the play event occurs.
      Returns:
      This object.
    • onplaying

      public Option onplaying(String value)
      Description copied from class: HtmlElement
      onplaying attribute.

      Event handler for when media playback starts after being paused or delayed.

      Overrides:
      onplaying in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the playing event occurs.
      Returns:
      This object.
    • onprogress

      public Option onprogress(String value)
      Description copied from class: HtmlElement
      onprogress attribute.

      Event handler for when the browser is downloading media data.

      Overrides:
      onprogress in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the progress event occurs.
      Returns:
      This object.
    • onratechange

      public Option onratechange(String value)
      Description copied from class: HtmlElement
      onratechange attribute.

      Event handler for when the playback rate of media changes.

      Overrides:
      onratechange in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the ratechange event occurs.
      Returns:
      This object.
    • onreset

      public Option onreset(String value)
      Description copied from class: HtmlElement
      onreset attribute.

      Event handler for when a form is reset.

      Overrides:
      onreset in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the reset event occurs.
      Returns:
      This object.
    • onresize

      public Option onresize(String value)
      Description copied from class: HtmlElement
      onresize attribute.

      Event handler for when the element is resized.

      Overrides:
      onresize in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the resize event occurs.
      Returns:
      This object.
    • onscroll

      public Option onscroll(String value)
      Description copied from class: HtmlElement
      onscroll attribute.

      Event handler for when the element's scrollbar is scrolled.

      Overrides:
      onscroll in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the scroll event occurs.
      Returns:
      This object.
    • onseeked

      public Option onseeked(String value)
      Description copied from class: HtmlElement
      onseeked attribute.

      Event handler for when a seek operation completes.

      Overrides:
      onseeked in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the seeked event occurs.
      Returns:
      This object.
    • onseeking

      public Option onseeking(String value)
      Description copied from class: HtmlElement
      onseeking attribute.

      Event handler for when a seek operation begins.

      Overrides:
      onseeking in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the seeking event occurs.
      Returns:
      This object.
    • onselect

      public Option onselect(String value)
      Description copied from class: HtmlElement
      onselect attribute.

      Event handler for when text is selected in the element.

      Overrides:
      onselect in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the select event occurs.
      Returns:
      This object.
    • onshow

      public Option onshow(String value)
      Description copied from class: HtmlElement
      onshow attribute.

      Event handler for when a context menu is shown.

      Overrides:
      onshow in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the show event occurs.
      Returns:
      This object.
    • onstalled

      public Option onstalled(String value)
      Description copied from class: HtmlElement
      onstalled attribute.

      Event handler for when media loading is stalled.

      Overrides:
      onstalled in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the stalled event occurs.
      Returns:
      This object.
    • onsubmit

      public Option onsubmit(String value)
      Description copied from class: HtmlElement
      onsubmit attribute.

      Event handler for when a form is submitted.

      Note:

      If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:

      • If using single quotes for attributes: onsubmit("return validate(\"form\")")
      • If using double quotes for attributes: onsubmit("return validate('form')")
      Overrides:
      onsubmit in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the submit event occurs.
      Returns:
      This object.
    • onsuspend

      public Option onsuspend(String value)
      Description copied from class: HtmlElement
      onsuspend attribute.

      Event handler for when media loading is suspended.

      Overrides:
      onsuspend in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the suspend event occurs.
      Returns:
      This object.
    • ontimeupdate

      public Option ontimeupdate(String value)
      Description copied from class: HtmlElement
      ontimeupdate attribute.

      Event handler for when the current playback position changes.

      Overrides:
      ontimeupdate in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the timeupdate event occurs.
      Returns:
      This object.
    • ontoggle

      public Option ontoggle(String value)
      Description copied from class: HtmlElement
      ontoggle attribute.

      Event handler for when a details element is opened or closed.

      Overrides:
      ontoggle in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the toggle event occurs.
      Returns:
      This object.
    • onvolumechange

      public Option onvolumechange(String value)
      Description copied from class: HtmlElement
      onvolumechange attribute.

      Event handler for when the volume of media changes.

      Overrides:
      onvolumechange in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the volumechange event occurs.
      Returns:
      This object.
    • onwaiting

      public Option onwaiting(String value)
      Description copied from class: HtmlElement
      onwaiting attribute.

      Event handler for when media playback stops to buffer more data.

      Overrides:
      onwaiting in class HtmlElementText
      Parameters:
      value - JavaScript code to execute when the waiting event occurs.
      Returns:
      This object.
    • selected

      public Option selected(Object value)
      selected attribute.

      Whether the option is selected by default.

      This attribute uses deminimized values:

      • false - Attribute is not added
      • true - Attribute is added as "selected"
      • Other values - Passed through as-is
      Parameters:
      value - The new value for this attribute. Typically a Boolean or String.
      Returns:
      This object.
    • spellcheck

      public Option spellcheck(Object value)
      Description copied from class: HtmlElement
      spellcheck attribute.

      Indicates whether the element should have its spelling and grammar checked.

      Possible values:

      • "true" - Enable spell checking for this element
      • "false" - Disable spell checking for this element
      Overrides:
      spellcheck in class HtmlElementText
      Parameters:
      value - Whether spell checking should be enabled.
      Returns:
      This object.
    • style

      public Option style(String value)
      Description copied from class: HtmlElement
      style attribute.

      Specifies inline CSS styles for the element. The value should be valid CSS property-value pairs separated by semicolons.

      Overrides:
      style in class HtmlElementText
      Parameters:
      value - Inline CSS styles (e.g., "color: red; font-size: 14px;").
      Returns:
      This object.
    • tabindex

      public Option tabindex(Object value)
      Description copied from class: HtmlElement
      tabindex attribute.

      Specifies the tab order of the element when navigating with the keyboard.

      Possible values:

      • Positive integer - Element is focusable and participates in tab order
      • "0" - Element is focusable but not in tab order
      • Negative integer - Element is not focusable
      Overrides:
      tabindex in class HtmlElementText
      Parameters:
      value - The tab order value for keyboard navigation.
      Returns:
      This object.
    • text

      public Option text(Object value)
      Description copied from class: HtmlElementText
      Sets the text node on this element.
      Overrides:
      text in class HtmlElementText
      Parameters:
      value - The text node to add to this element.
      Returns:
      This object.
    • title

      public Option title(String value)
      Description copied from class: HtmlElement
      title attribute.

      Specifies additional information about the element, typically displayed as a tooltip when the user hovers over the element.

      Overrides:
      title in class HtmlElementText
      Parameters:
      value - Tooltip text to display on hover (e.g., "Click to submit form").
      Returns:
      This object.
    • translate

      public Option translate(Object value)
      Description copied from class: HtmlElement
      translate attribute.

      Specifies whether the element's content should be translated when the page is localized.

      Possible values:

      • "yes" - Content should be translated (default)
      • "no" - Content should not be translated
      Overrides:
      translate in class HtmlElementText
      Parameters:
      value - Whether the element content should be translated.
      Returns:
      This object.
    • value

      public Option value(Object value)
      value attribute.

      Value to be used for form submission.

      Parameters:
      value - The new value for this attribute. Typically a Number or String.
      Returns:
      This object.