HTML DOM Input DatetimeLocal max 속성은 Input DatetimeLocal의 max 속성을 반환/설정합니다.
구문
다음은 구문입니다 -
- 문자열 값 반환
inputDatetimeLocalObject.max
- 최대 설정 문자열 값으로
inputDatetimeLocalObject.max = YYYY-MM-DDThh:mm:ss
문자열 값
여기 'YYYY-MM-DDThh:mm:ss' 다음과 같을 수 있습니다 -
| 문자열 값 | 세부정보 |
|---|---|
| YYYY | 연도를 정의합니다(예:2006) |
| MM | 월을 정의합니다(예:6월의 경우 06). |
| DD | 요일을 정의합니다(예:17) |
| T | 날짜와 시간 구분자입니다. |
| 헉 | 시간을 정의합니다(예:02) |
| mm | 분(예:21)을 정의합니다. |
| 초 | 초를 정의합니다(예:40) |
예시
Input DatetimeLocal max의 예를 살펴보겠습니다. 속성 -
<!DOCTYPE html>
<html>
<head>
<title>Input DatetimeLocal max</title>
<style>
form {
width:70%;
margin: 0 auto;
text-align: center;
}
* {
padding: 2px;
margin:5px;
}
input[type="button"] {
border-radius: 10px;
}
</style>
</head>
<body>
<form>
<fieldset>
<legend>Datetime-Local-max</legend>
<label for="datetimeLocalSelect">Insurance Expiration:
<input type="datetime-local" id="datetimeLocalSelect" value="2019-07-01T23:59:59" max="2019-08-01T23:59:59" disabled>
</label>
<input type="button" onclick="renewInsurance()" value="Renew Insurance">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var inputDatetimeLocal = document.getElementById("datetimeLocalSelect");
function renewInsurance() {
inputDatetimeLocal.max = '2029-07-01T23:59:59';
inputDatetimeLocal.value = inputDatetimeLocal.max;
divDisplay.textContent = 'Renewed Insurance: '+inputDatetimeLocal.value;
}
</script>
</body>
</html> 출력
이것은 다음과 같은 출력을 생성합니다 -
'보험 갱신'을 클릭하기 전에 버튼 -

'보험 갱신'을 클릭한 후 버튼 -
