[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/API/HTMLSelectElement [Back]  [Original]

HTMLSelectElement - Web API | MDN

MDN Web Docs

View in English Always switch to English

HTMLSelectElement

Baseline *

20157

*

HTMLSelectElement HTML <select> HTMLElement HTML

EventTarget Node Element HTMLElement HTMLSelectElement

HTMLElementElementNode

HTMLSelectElement.disabled

HTML disabled

HTMLSelectElement.form

HTMLFormElement <form> null

HTMLSelectElement.labels

NodeList <label>

HTMLSelectElement.length

unsigned long <option> select

HTMLSelectElement.multiple

HTML multiple

HTMLSelectElement.name

HTML name DOM

HTMLSelectElement.options

HTMLOptionsCollection <option> (HTMLOptionElement)

HTMLSelectElement.required

HTML required

HTMLSelectElement.selectedIndex

long <option> -1

HTMLSelectElement.selectedOptions

HTMLCollection <option>

HTMLSelectElement.size

long HTML size multiple true 1 4

HTMLSelectElement.type

multiple true "select-multiple" "select-one"

HTMLSelectElement.validationMessage

(willValidate false )

HTMLSelectElement.validity

ValidityState

HTMLSelectElement.value

option value

HTMLSelectElement.willValidate

false

HTMLElementElementNode

HTMLSelectElement.add()

select option

HTMLSelectElement.checkValidity()

invalid false

HTMLSelectElement.item()

<select>

HTMLSelectElement.namedItem()

option id name

HTMLSelectElement.remove()

select

HTMLSelectElement.reportValidity()

invalid false true

HTMLSelectElement.setCustomValidity()

showPicker()

HTMLElementElementNode

addEventListener() on

change

input

<input>, <select>, <textarea> value

js
/*  HTML 
<select id='s'>
    <option>First</option>
    <option selected>Second</option>
    <option>Third</option>
</select>
*/

const select = document.getElementById("s");

// 
console.log(select.selectedIndex); // 1

// 
console.log(select.options[select.selectedIndex].value); // Second

change <select> change

HTML
# htmlselectelement


Web Proxy Viewer  |  New URL  |  Original Page