• 회원가입
  • 로그인
  • 구글아이디로 로그인

[form] HTML - <input type="month"> 태그 - 연월(년월) 입력 (= 인풋먼스타입/먼스타입인풋/먼스인풋 요소)

목차
  1. <input type="month"> 예제 - 년월 입력
  2. <input type="month"> 정의
  3. <input type="month"> 구문

 

<input type="month"> 예제 - 년월 입력

 

<form action="/action_page.php">

  <label for="hzmonth">년월 선택:</label>

  <input type="month" id="hzmonth" name="hzmonth">

  <input type="submit">

</form>

 

결과보기 (전송키값쌍: hzmonth=2023-09)

 

<input type="month"> 정의

 

년월 선택 입력 가능한 INPUT 요소.

 


 

1.

  • YYYY-MM 형식으로 입력됨. (예) 2023-09
  • <label> 태그 사용 시, 웹접근성 향상됨.

 

2. cf.

  • <input type="date"> 태그 - (예) 2023-09-23
  • <input type="datetime-local"> 태그 - (예) 2023-09-23T22:25
  • <input type="month"> 태그 - 2023-09
  • <input type="time"> 태그 - (예) 22:25
  • <input type="week"> 태그 - (예) 2023-W38

 

3.

  • Chrome, Edge, Opera 최신 브라우저는 지원.
  • Firefox, Safari 브라우저는 지원 X

 

4. MDN <input type="month"> 예제보기

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month

 

 

<input type="month"> 구문

 

<input type="month">

 

 

방문 감사합니다. (즐겨찾기 등록: Ctrl + D)

분류 제목
게시물이 없습니다.
22/18
목록
찾아주셔서 감사합니다. Since 2012