| 2 | const minutehand=document.querySelector('.hourhand'); |
| 3 | const audio = document.querySelector('.audio'); |
| 4 | function setdate() { |
| 5 | const now = new Date(); |
| 6 | const seconds = now.getSeconds(); |
| 7 | const a = (seconds*6); |
| 8 | console.log(a); |
| 9 | |
| 10 | |
| 11 | secondhand.style.transform = `rotate(${a}deg)`; |
| 12 | audio.play(); |
| 13 | audio.currentTime = 1; |
| 14 | |
| 15 | |
| 16 | |
| 17 | //using properties that have : , :is replaced by = and than the ahead part comes in backticks |
| 18 | //whenever you are writing a varible const use ${} and whenever you use ${} you must use `` backtics (i.e esc down button) to close your brackets |
| 19 | // how to change the class of an elemt by js , make that new class in css and use elementconstname.classList.add('newstyleclassname'); |
| 20 | |
| 21 | } |
| 22 | |
| 23 | function setminute() { |
| 24 | const now = new Date(); |