web api instance property
HTMLSelectElement: required property
The required property of the HTMLSelectElement interface specifies that the user must select an option with a non-empty string value before submitting a form. It reflects the <select> element’s required attribute.
Value
A boolean.
Examples
const selectElement = document.getElementById("fruits");
console.log(selectElement.required);
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.