Page1207 JS

5949 단어 페이지페이지
//음악 배열 교수님 도와주세요
const music = document.querySelector('.music');
function getMusic(){
    const music = "https://drive.google.com/uc?export=download&id=1Il4aEI7ux-RsxOLqzGib-QFPxyVRnxUQ"
}


//시계 구현
const clock = document.querySelector('.clock');
function getTime(){
    const time = new Date();
    const hour = time.getHours();
    const minutes = time.getMinutes();
    const seconds = time.getSeconds();
    //clock.innerHTML = hour +":" + minutes + ":"+seconds;
    clock.innerHTML = `${hour<10 ? `0${hour}`:hour}:${minutes<10 ? `0${minutes}`:minutes}:${seconds<10 ? `0${seconds}`:seconds}`
}
function init(){
    setInterval(getTime, 1000);
}



init();

좋은 웹페이지 즐겨찾기