개발자의 길

html5 추가된 form input 태그들 본문

10. HTML

html5 추가된 form input 태그들

자르르 2015. 12. 30. 16:57


1. 새로운 input types

  • color
  • date
  • datetime
  • datetime-local
  • email
  • month
  • number
  • range
  • search
  • tel
  • time
  • url
  • week

2. 새로운 form elements

  • <datalist>
  • <keygen>
  • <output>

3. 새로운 input attributes

  • autocomplete
  • autofocus
  • form
  • formaction
  • formenctype
  • formmethod
  • formnovalidate
  • formtarget
  • height and width
  • list
  • min and max
  • multiple
  • pattern (regexp)
  • placeholder
  • required
  • step

4. 새로운 form attributes

  • autocomplete
  • novalidate


  1. <!DOCTYPE html>
  2. <meta charset="EUC-KR">
  3. <title>Insert title here</title>
  4. </head>
  5.     <form action="search_result.jsp">  
  6.         <table>
  7.             <tr>
  8.                 <td>search</td>
  9.                 <td><input type="search" autofocus="autofocus"/></td>
  10.             </tr>
  11.         </table>
  12.     </form>
  13.    
  14.     <form action="form_result.jsp">
  15.         <table border="1">
  16.            
  17.             <tr>
  18.                 <td colspan="2"><input type="submit"/> | <input type="reset"/></td>
  19.             </tr>
  20.             <tr>
  21.                 <td>text,placeholder,pattern,title</td>
  22.                 <td><input type="text" required="required" placeholder="우편번호" pattern="\d{3}-\d{3}" title="111-111양식"/></td>
  23.             </tr>
  24.            
  25.             <tr>
  26.                 <td>number</td>
  27.                 <td><input type="number" required="required" min="0" max="9" step="1"/></td>
  28.             </tr>
  29.            
  30.             <tr>
  31.                 <td>range</td>
  32.                 <td><input type="range" required="required" min="0" max="100" step="5"/></td>
  33.             </tr>
  34.            
  35.             <tr>
  36.                 <td>url</td>
  37.                 <td><input type="url" required="required"/></td>
  38.             </tr>
  39.            
  40.             <tr>
  41.                 <td>email</td>
  42.                 <td><input type="email" required="required"/></td>
  43.             </tr>
  44.            
  45.             <tr>
  46.                 <td>date</td>
  47.                 <td><input type="date" required="required"/></td>
  48.             </tr>
  49.            
  50.             <tr>
  51.                 <td>month</td>
  52.                 <td><input type="month" required="required"/></td>
  53.             </tr>
  54.            
  55.             <tr>
  56.                 <td>week</td>
  57.                 <td><input type="week" required="required"/></td>
  58.             </tr>
  59.            
  60.             <tr>
  61.                 <td>time</td>
  62.                 <td><input type="time" required="required"/></td>
  63.             </tr>
  64.            
  65.             <tr>
  66.                 <td>color</td>
  67.                 <td><input type="color" required="required"/></td>
  68.             </tr>
  69.             <tr>
  70.                 <td>datalist</td>
  71.                 <td>
  72.                     <input list="browsers">
  73.                     <datalist id="browsers">
  74.                       <option value="Internet Explorer">
  75.                       <option value="Firefox">
  76.                       <option value="Chrome">
  77.                       <option value="Opera">
  78.                       <option value="Safari">
  79.                     </datalist>
  80.                 </td>
  81.             </tr>
  82.         </table>
  83.     </form>
  84. </body>
  85. </html>
[chrome 에서 test]






이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.
공유하기 링크
Comments