1. 首页
  2. 跨平台
  3. Cordova
  4. 用js实现每隔一秒刷新时间的实例(含年月日时分秒)

用js实现每隔一秒刷新时间的实例(含年月日时分秒)

上传者: 2020-11-29 12:39:28上传 PDF文件 37.88KB 热度 17次
原理:使用定时器,即setInterval(fn,i),每隔i秒执行fn。 下面给出具体的代码 1.代码如下: <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>用js实现每隔一秒刷新时间(含年月日时分秒)</title> <style> #time{background:#33F; color:white; height:30px; line-height:30px;
下载地址
用户评论