pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://developer.mozilla.org/ja/docs/Web/API/HTMLInputElement/minLength

/>

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

HTMLInputElement: minLength プロパティ

Baseline Widely available

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

minLengthHTMLInputElement インターフェイスのプロパティで、この <input> 要素の値として必要な最小文字数(UTF-16 コード単位)を示します。これは、この要素の minlength 属性を反映します。-1 は、必要な最小文字数がないことを意味します。

メモ: 入力に値があり、その値が minlength 属性で要求される文字数よりも少ない場合、その要素は無効と見なされ、ValidityState オブジェクトの tooShort プロパティが true になります。

存在する場合は要素の minlength を表す数値、さもなくば -1

次の HTML があったとします。

html
<p>
  <label for="password">パスワード</label>
  <input id="password" type="password" minlength="8" maxlength="20" />
</p>

minLength プロパティを使用して、<input>minlength 属性値を取得または設定することができます。

js
const inputElement = document.querySelector("#password");
console.log(`要素の minLength: ${inputElement.minLength}`); // "要素の minlength: 8"
inputElement.minLength = 12; // この要素の minlength 属性値を更新

仕様書

Specification
HTML
# dom-input-minlength

ブラウザーの互換性

関連情報

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy