HTML <input> minlength 속성

정의와 사용법

minlength 属性이 <input> 元素에 필요한 최소 문자 수를 정의합니다.

주의:minlength 이 속성은 다음 입력 유형에 사용할 수 있습니다:

  • text
  • search
  • url
  • tel
  • email
  • password

예제

최소 길이가 8자의 <input> 요소:

<form action="/action_page.php">
  <label for="password">비밀번호:</label>
  <input type="password" id="password" name="password" minlength="8"><br><br>
  <input type="submit" value="제출">
</form>

직접 시험해 보세요

문법

<input minlength="number">

속성 값

설명
number <input> 요소에서 필요한 최소 문자 수.

브라우저 지원

표에서는 해당 속성을 최초로 완전히 지원한 브라우저 버전을 나타냅니다.

크롬 에지 파이어폭스 사파리 오페라
크롬 에지 파이어폭스 사파리 오페라
40.0 17.0 51.0 10.1 27.0