HTML DOM Embed 對象

Embed 對象

Embed 對象是 HTML5 中的新對象。

Embed 對象表示 HTML <embed> 元素。

訪問 Embed 對象

您可以通過使用 getElementById() 來訪問 <embed> 元素:

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

親自試一試

創建 Embed 對象

您可以通過使用 document.createElement() 方法來創建 <embed> 元素:

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

親自試一試

Embed 對象屬性

屬性 描述
height 設置或返回 embed 元素中 height 屬性的值。
src 設置或返回 embed 元素中 src 屬性的值。
type 設置或返回 embed 元素中 type 屬性的值。
width 設置或返回 embed 元素中 width 屬性的值。

標準屬性和事件

Embed 對象支持標準屬性事件

相關頁面

HTML 教程:HTML 插件

HTML 參考手冊:HTML <embed> 標簽