码迷,mamicode.com
首页 > 其他好文 > 详细

补零补零

时间:2017-02-05 10:52:57      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:bsp   min   onclick   get   join   target   return   cond   turn   

var _ = [‘00‘, ‘01‘, ‘02‘, ‘03‘, ‘04‘, ‘05‘, ‘06‘, ‘07‘, ‘08‘, ‘09‘], //补零
d = new Date(),
h = d.getHours(),
m = d.getMinutes(),
s = d.getSeconds();
return [_[h] || h, _[m] || m, _[s] || s].join(":");

 

======

1,this[监听器的对象]
2,event.target[当前目标对象]
<ul onclick="test()">
<li></li>
</ul>

1,你按那里都是:
<ul onclick="test()">
<li></li>
</ul>
2,他可能是ul or li

补零补零

标签:bsp   min   onclick   get   join   target   return   cond   turn   

原文地址:http://www.cnblogs.com/jayruan/p/6366921.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!