怎么在中间实现文字啊
window.setInterval(function() { var myDate = new Date(); var second = ""; var minute = ""; if (myDate.getSeconds().toString().length == 1) { second = "0" + myDate.getSeconds().toString() } else { second = myDate.getSeconds() } if (myDate.getMinutes().toString().length == 1) { minute = "0" + myDate.getMinutes().toString() } else { minute = myDate.getMinutes() } innerClockDom.innerHTML = myDate.getHours() + ":" + minute + ":" + second }, 1000) }
在innerClockDom.innerHTML加入你要的文本拼接 如"倒计时"+myDate.getHours() + ":" + minute + ":" + second