Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2018年4月.
minLength は HTMLInputElement インターフェイスのプロパティで、この <input> 要素の値として必要な最小文字数(UTF-16 コード単位)を示します。これは、この要素の minlength 属性を反映します。-1 は、必要な最小文字数がないことを意味します。
メモ: 入力に値があり、その値が minlength 属性で要求される文字数よりも少ない場合、その要素は無効と見なされ、ValidityState オブジェクトの tooShort プロパティが true になります。
存在する場合は要素の minlength を表す数値、さもなくば -1。
次の HTML があったとします。
minLength プロパティを使用して、<input> の minlength 属性値を取得または設定することができます。
| HTML # dom-input-minlength |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年4月12日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.