ValidityState.valueMissing

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since December 2018.

valueMissingValidityState オブジェクトの読み取り専用プロパティで、必須 (required) のコントロール、例えば <input>, <select>, <textarea> の値が空であることを示します。

required 属性が設定されており、<option> が選択されていない場合、または <textarea> やユーザーが編集できる <input> が空の場合、 valueMissing 属性は true になります。このプロパティは、フィールドが必須かつ値がない場合にのみ true となります。フィールドが必須でない場合、またはフィールドが必須でも値がある場合には、値は false となります。

仕様書

Specification
HTML
# dom-validitystate-valuemissing-dev

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
valueMissing

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報