HTML DOM Source 对象

Source 对象是 html5 中新增的

Source 对象表示一个 HTML <source> 元素


访问 Source 对象

可以使用 getElementById() 来访问 <source> 元素

var x = document.getElementById("mySource");


创建 Source 对象

可以使用 document.createElement() 方法来创建 <source> 元素

var x = document.createElement("source");


Source 对象属性

属性描述
media设置或返回 元素中 media 属性的值
src设置或返回 元素中 src 属性的值
type设置或返回 元素中 type 属性的值


本文内容仅供个人学习/研究/参考使用,不构成任何决策建议或专业指导。分享/转载时请标明原文来源,同时请勿将内容用于商业售卖、虚假宣传等非学习用途哦~感谢您的理解与支持!

链接: https://fly63.com/course/10_680

目录选择