Module

x/evt/lib/index.ts

šŸ’§EventEmitter's typesafe replacement
Go to Latest
interface dom.HTMLSelectElement
implements HTMLElement
import { type dom } from "https://deno.land/x/evt@v2.3.1/lib/index.ts";
const { HTMLSelectElement } = dom;

A HTML Element. These elements also share all of the properties and methods of other HTML elements via the HTMLElement interface.

Properties

autocomplete: string
disabled: boolean
readonly
form: HTMLFormElement | null

Retrieves a reference to the form that the object is embedded in.

readonly
labels: NodeListOf<HTMLLabelElement>
length: number

Sets or retrieves the number of objects in a collection.

multiple: boolean

Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.

name: string

Sets or retrieves the name of the object.

readonly
options: HTMLOptionsCollection
required: boolean

When present, marks an element that can't be submitted without a value.

selectedIndex: number

Sets or retrieves the index of the selected option in a select object.

readonly
selectedOptions: HTMLCollectionOf<HTMLOptionElement>
size: number

Sets or retrieves the number of rows in the list box.

readonly
type: string

Retrieves the type of select control based on the value of the MULTIPLE attribute.

readonly
validationMessage: string

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.

readonly
validity: ValidityState

Returns a ValidityState object that represents the validity states of an element.

value: string

Sets or retrieves the value which is returned to the server when the form control is submitted.

readonly
willValidate: boolean

Returns whether an element will successfully validate based on forms validation rules and constraints.

Methods

add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void

Adds an element to the areas, controlRange, or options collection.

checkValidity(): boolean

Returns whether a form will validate when it is submitted, without having to submit it.

item(index: number): Element | null

Retrieves a select object or an object from an options collection.

namedItem(name: string): HTMLOptionElement | null

Retrieves a select object or an object from an options collection.

remove(): void

Removes an element from the collection.

remove(index: number): void
reportValidity(): boolean
setCustomValidity(error: string): void

Sets a custom error message that is displayed when a form is submitted.

addEventListener<K extends keyof HTMLElementEventMap>(
type: K,
listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof HTMLElementEventMap>(
type: K,
listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void