0

HELP; JS/HTML/CSS Clock function

It doesn't seem to work, can someone help me out here? var diallines = document.getElementbyClassName ('diallines') var clockE1 = document.getElementByClassName ('clock')[0]; for(var i = 1; i < 60; i++) { clockE1.innerHTML += "<div class='diallines'</div>" diallines[i].style.transform = "rotate(" + 6 * i + "deg)"; } function clock(){ var weekday = new Array(7), d = new date(), h = d.getHours(), m = d.getMinutes(), s = d.getSeconds(), date = getDate(), month = d.getMonth() + 1, year = d.getYear(), hDeg = h * 30 + m * (360/720), mDeg = m * 30 + s * (360/720), sDeg = s * 6, hE1 = document.querySelector('.hour-hand'), mE1 = document.querySelector('.minute-hand'), sE1 = document.querySelector('.second-hand'), dateE1 = document.querySelector('.date'), dayE1 = document.querySelector('.day'); weekday[0] = "Sunday"; weekday[0] = "Monday"; weekday[0] = "Tuesday"; weekday[0] = "Wednesday";

27th Mar 2019, 10:03 AM
Ohcfet
Ohcfet - avatar
2 Answers
+ 6
You have many typing mistake and other syntax errors too, and JS codes that access dom, should run from onload callback in Sololearn JS pane. Here i have corrected some of your errors. https://code.sololearn.com/W4xX092Xgo57/?ref=app
27th Mar 2019, 10:37 AM
CalviŐ˛
CalviŐ˛ - avatar
0
https://code.sololearn.com/Wa25p5Y1Trrn/?ref=app
27th Mar 2019, 10:04 AM
Ohcfet
Ohcfet - avatar