我想使用原生JavaScript或jQuery来更改HTML视频标签上的poster属性。任何帮助都将不胜感激。
<div id="videoplayer" class="video-player" style="overflow: hidden; width: 582px; height: 326px; ">
<div id="myPlayer">
<video id="htmlFive" width="100%" height="100%" controls="" poster="undefined">
<source src="blank.m3u8">
</video>
</div>
</div>谢谢!
发布于 2012-10-11 04:46:59
要在本地执行此操作,只需更改属性:
document.getElementById('htmlFive').setAttribute('poster','newvalue');
发布于 2012-10-11 03:03:42
使用jQuery的attr方法,例如:
$('#htmlFive').attr('poster', 'newvalue')或本机setAttribute
document.querySelector('#htmlFive').setAttribute('poster', 'newvalue')发布于 2012-10-11 03:04:08
$('#video source').attr('src', srcPath);https://stackoverflow.com/questions/12826478
复制相似问题