행동으로 성공하는 잭디자인랩 jackdesignlab, Action is the only way to success

간단한 simple 디데이 d-day 계산기 calculator 입니다~ (html 코드 code 포함)

간단한 simple 디데이 d-day 계산기 calculator 입니다~ ( html 코드 code 포함 )

디데이 계산기 / simple d-day calculator

디데이 계산기 / simple d-day calculator


간단한 디데이 d-day 계산기 입니다.

아래는 html 코드 code 입니다~ (바드야 고마워~^^;)

<html>
<head>
<title>디데이 계산기</title>
</head>
<body>
<h1>디데이 계산기</h1>
<input type=”date” id=”start-date” value=”2023-08-01″>
<input type=”date” id=”end-date” value=”2023-10-16″>
<button onclick=”calculate()”>계산하기</button>
<div id=”result”></div>
<script> function calculate() {

// 시작 날짜와 종료 날짜를 가져옵니다.
const start = new Date(document.getElementById(“start-date”).value);
const end = new Date(document.getElementById(“end-date”).value);

// 디데이를 계산합니다.
const days = (end – start) / (1000 * 60 * 60 * 24);

// 결과를 표시합니다.
document.getElementById(“result”).innerHTML = days + “일”;

}

</script>
</body>
</html>

간단하게 구현된 디데이 계산기~ 코드는 구글 바드 bard 가 짜준 거랍니다~^^

참 편리한 세상 입니다!


행동으로 성공하는 잭디자인랩 jackdesignlab, Action is the only way to success에서 더 알아보기

지금 구독하여 계속 읽고 전체 아카이브에 액세스하세요.

계속 읽기