$(function () { var date = new Date(); var year = date.getYear(); var month = date.getMonth(); var riqi = date.getDay(); var hour = date.getHours(); var minutes = date.getMinutes(); var second = date.getSeconds(); if(second <10){ second = "0" + second; } var shijian = year + "年" + " " + month + "月" + " " + riqi + "月" + " " + hour + ":" + " " + minutes + ":" + " " + second; var p1 = document.getElementById("p1"); p1.innerText = shijian; }); setInterval("","1000") 我想设置个定时器。调用上面的匿名函数, 不知道这个定时器里面怎么写、
- 1 回答
- 0 关注
- 512 浏览
添加回答
举报
0/150
提交
取消