<div class="myMedia" id="myMedia">
<video poster="{{=data.pic}}" data-config='{"mediaTitle": "{{=data.title}}"}'>
<source id="mySource{{=data.id}}" src="{{=data.videos}}" type="video/mp4" >
</video>
</div>
<div class="myMedia" id="myMedia">
<video poster="{{=data.pic}}" data-config='{"mediaTitle": "{{=data.title}}"}'>
<source id="mySource{{=data.id}}" src="{{=data.videos}}" type="video/mp4" >
</video>
</div>
<div class="myMedia" id="myMedia">
<video poster="{{=data.pic}}" data-config='{"mediaTitle": "{{=data.title}}"}'>
<source id="mySource{{=data.id}}" src="{{=data.videos}}" type="video/mp4" >
</video>
</div>
如上代码,用dot.js渲染模板,js如何循环如上视频列表?
var myMedia = document.getElementsByClassName("myMedia");
for (var i = 0, len = myMedia.length; i < len; i++) {}
如何把视频列表循环出来? 然后获得<source>里的src值呢?
慕标5832272
相关分类