Interface HTMLSelectElement

All Superinterfaces:
Element, EventTarget, HTMLElement, InnerHTML, Node, NonDocumentTypeChildNode, ParentNode
All Known Implementing Classes:
HTMLSelectElementImpl

public interface HTMLSelectElement extends HTMLElement
A <select> HTML Element. These elements also share all of the properties and methods of other HTML elements via the HTMLElement interface.
  • Method Details

    • isAutocomplete

      boolean isAutocomplete()
      Gets autocomplete.
      Returns:
      the autocomplete
    • setAutocomplete

      void setAutocomplete(String autocomplete)
      Sets autocomplete.
      Parameters:
      autocomplete - the autocomplete
    • isAutofocus

      boolean isAutofocus()
      Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
      Returns:
      the boolean
    • setAutofocus

      void setAutofocus(boolean autofocus)
      Sets autofocus.
      Parameters:
      autofocus - the autofocus
    • isDisabled

      boolean isDisabled()
      Is disabled boolean.
      Returns:
      the boolean
    • setDisabled

      void setDisabled(boolean disabled)
      Sets disabled.
      Parameters:
      disabled - the disabled
    • getForm

      HTMLFormElement getForm()
      Retrieves a reference to the form that the object is embedded in.
      Returns:
      the form
    • getLabels

      NodeList getLabels()
      Gets labels.
      Returns:
      the labels
    • setLength

      void setLength(int length)
      Sets or retrieves the number of objects in a collection.
      Parameters:
      length - the length
    • isMultiple

      boolean isMultiple()
      Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.
      Returns:
      the boolean
    • setMultiple

      void setMultiple(boolean multiple)
      Sets multiple.
      Parameters:
      multiple - the multiple
    • getName

      String getName()
      Sets or retrieves the name of the object.
      Returns:
      the name
    • setName

      void setName(String name)
      Sets name.
      Parameters:
      name - the name
    • getOptions

      HTMLOptionsCollection getOptions()
      Gets options.
      Returns:
      the options
    • isRequired

      boolean isRequired()
      When present, marks an element that can't be submitted without a value.
      Returns:
      the boolean
    • setRequired

      void setRequired(boolean required)
      Sets required.
      Parameters:
      required - the required
    • getSelectedIndex

      int getSelectedIndex()
      Sets or retrieves the index of the selected option in a select object.
      Returns:
      the selected index
    • setSelectedIndex

      void setSelectedIndex(int selectedIndex)
      Sets selected index.
      Parameters:
      selectedIndex - the selected index
    • getSelectedOptions

      HTMLCollection getSelectedOptions()
      Gets selected options.
      Returns:
      the selected options
    • getSize

      int getSize()
      Sets or retrieves the number of rows in the list box.
      Returns:
      the size
    • setSize

      void setSize(int size)
      Sets size.
      Parameters:
      size - the size
    • getType

      String getType()
      Retrieves the type of select control based on the value of the MULTIPLE attribute.
      Returns:
      the type
    • getValidationMessage

      String getValidationMessage()
      Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
      Returns:
      the validation message
    • getValidity

      ValidityState getValidity()
      Returns a ValidityState object that represents the validity states of an element.
      Returns:
      the validity
    • getValue

      String getValue()
      Sets or retrieves the value which is returned to the server when the form control is submitted.
      Returns:
      the value
    • setValue

      void setValue(String value)
      Sets value.
      Parameters:
      value - the value
    • isWillValidate

      boolean isWillValidate()
      Returns whether an element will successfully validate based on forms validation rules and constraints.
      Returns:
      the boolean
    • add

      void add(Object element, Object before)
      Adds an element to the areas, controlRange, or options collection.
      Parameters:
      element - Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.
      before - Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
    • add

      void add(Object element)
      Add.
      Parameters:
      element - the element
    • checkValidity

      boolean checkValidity()
      Returns whether a form will validate when it is submitted, without having to submit it.
      Returns:
      the boolean
    • item

      Element item(int index)
      Retrieves a select object or an object from an options collection.
      Parameters:
      index - Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.
      Returns:
      the element
    • namedItem

      HTMLOptionElement namedItem(String name)
      Retrieves a select object or an object from an options collection.
      Parameters:
      name - A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.
      Returns:
      the html option element
    • remove

      void remove()
      Removes an element from the collection.
    • remove

      void remove(Object element)
      Remove.
      Parameters:
      element - the element
    • reportValidity

      boolean reportValidity()
      Report validity boolean.
      Returns:
      the boolean
    • setCustomValidity

      void setCustomValidity(String error)
      Sets a custom error message that is displayed when a form is submitted.
      Parameters:
      error - Sets a custom error message that is displayed when a form is submitted.
    • setItem

      void setItem(Integer index, Node Node)
      Set Item.
      Parameters:
      index - the name
      Node - the value
    • getLength

      int getLength()

      getLength.

      Returns:
      a Integer object.