+ 1
<!DOCTYPE html> What is wrong with this code
<!DOCTYPE html> <html> <head> <script> function startTime() { var today = new Date(); var h = today.getHours(); var m = today.getMinutes(); var s = today.getSeconds(); m = checkTime(m); s = checkTime(s); document.getElementById('txt').innerHTML = h + ":" + m + ":" + s; var t = setTimeout(startTime, 500); } function checkTime(i) { if (i < 010) {i = "0" + i}; return i;
2 Respostas
+ 6
Is this your complete code or just a snippet? As Iman said, you haven't closed the checkTime function but if this is the complete code it's missing plenty of other things.
Can you make your code public and add the link?
+ 1
You should close the checkTime function I guess