HTML DOM Source 对象

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 设置或返回 <source> 元素中 media 属性的值。
src 设置或返回 <source> 元素中 src 属性的值。
type 设置或返回 <source> 元素中 type 属性的值。

标准属性和事件

Source 对象支持标准属性事件

相关页面

HTML 参考手册:HTML <source> 标签

系统帮助 | 给我留言 | 收藏本站
Copyright © 2005-2008 www.cnn84.com All Rights Reserved Ver:2.0
CNN84网是公益性便民网站,是为了给大家的日常生活查询及提供最快捷的出行指南