getTime()用jquery的话要怎么写
来源:8-8 作业讲解:课程内容中增加文件管理

慕神4535282
2020-08-06
老师,请教一下,你写的getTime()函数,
getTime() {
let _this = this;
let ele = document.getElementById(“video”);
_this.section.time = parseInt(ele.duration, 10);
}
如果用jquery要怎么写呢?
我试过写成
getTime() {
let _this = this;
let ele = $("#video");
_this.section.time = parseInt(ele.duration, 10);
}
结果不能正常获取得到时长,谢谢!
写回答
1回答
-
甲蛙
2020-08-06
应该用ele[0].duration,你可以把console.log(ele),其实得到的是一个数组
022020-08-09
相似问题