IT/html

HTML 입력 제한(Input Restrictions) 1

조원태 2017. 1. 8. 16:06
반응형


입력 제한(Input Restrictions)

몇 가지 일반적인 입력 제한 목록이 있습니다 (일부는 HTML5에서 새로 추가되었습니다).


AttributeDescription
disabledSpecifies that an input field should be disabled
maxSpecifies the maximum value for an input field
maxlengthSpecifies the maximum number of character for an input field
minSpecifies the minimum value for an input field
patternSpecifies a regular expression to check the input value against
readonlySpecifies that an input field is read only (cannot be changed)
requiredSpecifies that an input field is required (must be filled out)
sizeSpecifies the width (in characters) of an input field
stepSpecifies the legal number intervals for an input field
valueSpecifies the default value for an input field


다음 장에서는 입력 제한에 대해 자세히 설명합니다. 다음 예제에서는 0에서 100 사이의 값을 10 단위로 입력 할 수있는 숫자 입력 필드를 표시합니다. 기본값은 30입니다. OperaSafariChromeFirefoxInternet Explorer 예 <form>   수량:   <input type = "number"name = "points"min = "0"max = "100"step = "10"value = "30"> </ form>

반응형