본문 바로가기

프로그램/HTML

Input 제한(Restrictions) (some are new in 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

Example


<input type="number" name="points" min="0" max="100" step="10" value="30">
<input type="date" name="bday">
<input type="date" name="bday" max="1979-12-31">
<input type="range" name="points" min="0" max="10">
<input type="month" name="bdaymonth">
<input type="week" name="week_year">
<input type="time" name="usr_time">
<input type="datetime" name="bdaytime">
<input type="datetime-local" name="bdaytime">
<input type="email" name="email">
<input type="search" name="googlesearch">
<input type="tel" name="usrtel">
<input type="url" name="homepage">

'프로그램 > HTML' 카테고리의 다른 글

HTML Character Entity Reference  (0) 2018.06.02