자바스크립트 응용편
카운트다운 타이머 1. 남은 시간을 계산하는 함수 var countdown = function (due) { var now = new Date(); var rest = due.getTime() - now.getTime(); var sec = Math.floor(rest / 1000 % 60); var min = Math.floor(rest / 1000 / 60) % 60; var hours = Math.floor(rest / 1000 / 60 / 60) % 24; var days = Math.floor(rest / 1000 / 60 / 60 / 24); var count = [days, hours, min, sec]; return count; } var goal = new Date(); goal.setH..
2021.05.03