Latest web development tutorials

HTML DOM Embed Objects

Embed the object

Embed the object is new in HTML5.

Embed object represents an HTML <embed> element.

Access Embed Objects

You can use getElementById () to access the <embed> element:

var x = document.getElementById("myEmbed"); 尝试一下

Create Object Embed

You can use document.createElement () to create the <embed> element:

var x = document.createElement("myEmbed"); 尝试一下

Embed Object Properties

Property 描述
height 设置或者返回嵌入文件的高度(height属性值)
src 设置或者返回 embed 元素的 src 属性值(嵌入文件地址)
type 设置或者返回 embed 元素的 type 属性值(嵌入文件类型)
width 设置或者返回嵌入文件的宽度(width属性值)

Standard properties and events

Embed the object also supports the standard attributes and events .


related articles

HTML Reference Manual: HTML <the embed> tag