![](https://img-blog.csdnimg.cn/20200706150213452.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Js
js
嘉戈
No end for learning
展开
-
时间戳转时间-js封装函数
文章目录jshtml效果显示jsformatTime.js: /* * 时间戳格式转正常时间格式显示 */ /**格式化日期,如月、日、时、分、秒保证为2位数 * @param {Object} n */ function formatNumber (n) { n = n.toString() return n[1] ? n : '0' + n;...原创 2019-12-23 15:22:44 · 609 阅读 · 3 评论 -
使用charAt()方法截取姓名字符串后两位
定义:charAt() 方法可返回指定位置的字符。JavaScript 并没有一种有别于字符串类型的字符数据类型,所以返回的字符是长度为 1 的字符串。语法:stringObject.charAt(index)TIY<html><body><script type="text/javascript">var str="Hello worl...原创 2020-03-31 22:08:32 · 1252 阅读 · 0 评论