如何使用 javascript 更改元素的属性值
我有一个带有属性的视频元素。我想做的就是改变这些属性。我如何用 JavaScript 做到这一点?
这是我的带有属性的视频元素
<video id="VideoElement" src="video/surfing.ogv" controls poster="images/surfing.jpg" width="480" height="300"></video>
I have a video element with attributes. All I want to do is change those attributes. How do I do this with javascript?
This is my video element with attributes
<video id="VideoElement" src="video/surfing.ogv" controls poster="images/surfing.jpg" width="480" height="300"></video>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
非jquery解决方案:
A non-jquery solution:
对于其他属性也类似。
该解决方案不需要 jQuery
Similarly, for other attributes.
This solution does not require jQuery