<script>
setInterval(()=>{
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth()+1;
let day = date.getDate();
let hours = date.getHours();
let minutes = date.getMinutes();
let seconds = date.getSeconds();
let yoil = date.getDay();
let han_yoil = '';
switch(yoil){
case 0 :
han_yoil='sunday'
break;
case 1 :
han_yoil='monday'
break;
case 2 :
han_yoil='tuesday'
break;
case 3 :
han_yoil='wednesday'
break;
case 4 :
han_yoil='thursday'
break;
case 5 :
han_yoil='friday'
break;
case 6 :
han_yoil='saturday'
break;
}
let time = document.getElementById('time');
let time2 = document.getElementById('time2');
let content = `${year}년${month}월${day}일(${han_yoil})${hours}시간${minutes}분${seconds}초`
time.innerHTML = `<h1>${content}</h1>`
time2.innerText = `<h1>${content}</h1>`
let nowElement = document.createElement('h1')
nowElement.setAttribute('id','bigTime');
nowElement.textContent = content;
time2.appendChild(nowElement);
let nowElementId = time2.getAttribute('id')
console.log(nowElementId);
},1000)
</script>