Skip to main content

ElementDropdown

Namespace for creating <select>-based dropdown menus.

Index

Functions

Create

  • Create(id, optionsList, onChange, options, htmlOptions): HTMLSelectElement
  • Construct a <select>-based dropdown menu.


    Parameters

    • id: string

      The name of the select item.

    • optionsList: readonly (string | HTMLOptions<hr> | Omit<HTMLOptions<option>, tag>)[]

      The list of options for the current select statement. Can be supplied as a simple string or a more extensive <option> config.

    • onChange: (this, event) => any

      An event listener to be called, when the value of the drop down box changes

      • optionaloptions: { disabled?: boolean; multiple?: boolean; name?: string; required?: boolean; size?: number } = null

        Additional <select>-specific properties

        • optionaldisabled: boolean
        • optionalmultiple: boolean
        • optionalname: string
        • optionalrequired: boolean
        • optionalsize: number
      • htmlOptions: Partial<Record<select, Omit<HTMLOptions<select>, tag>>> = null

        Additional ElementCreate options to-be applied to the respective (child) element

      Returns HTMLSelectElement

      • The created element

    CreateLabelled

    • CreateLabelled(id, optionsList, label, onChange, options, htmlOptions): HTMLLabelElement
    • Construct a <select>-based dropdown menu.


      Parameters

      • id: string

        The name of the select item.

      • optionsList: readonly (string | HTMLOptions<hr> | Omit<HTMLOptions<option>, tag>)[]

        The list of options for the current select statement. Can be supplied as a simple string or a more extensive <option> config.

      • label: string

        The label of the dropdown menu.

      • onChange: (this, event) => any

        An event listener to be called, when the value of the drop down box changes

        • optionaloptions: { disabled?: boolean; multiple?: boolean; name?: string; required?: boolean; size?: number } = null

          Additional <select>-specific properties

          • optionaldisabled: boolean
          • optionalmultiple: boolean
          • optionalname: string
          • optionalrequired: boolean
          • optionalsize: number
        • htmlOptions: Partial<Record<label | select | container, Omit<HTMLOptions<any>, tag>>> = null

          Additional ElementCreate options to-be applied to the respective (child) element

        Returns HTMLLabelElement

        • The created element
      Page Options