HTML DOM ฝังวัตถุ
ฝังวัตถุ
วัตถุฝังแสดงถึงองค์ประกอบ HTML <ฝัง>
เข้าถึงวัตถุฝังตัว
คุณสามารถเข้าถึง <embed> องค์ประกอบโดยใช้ getElementById():
ตัวอย่าง
var x = document.getElementById("myEmbed");
สร้างวัตถุฝังตัว
คุณสามารถสร้าง <embed> องค์ประกอบโดยใช้ document.createElement() วิธีการ:
ตัวอย่าง
var x = document.createElement("EMBED");
ฝังคุณสมบัติของอ็อบเจ็กต์
Property | Description |
---|---|
height | Sets or returns the value of the height attribute in an embed element |
src | Sets or returns the value of the src attribute in an embed element |
type | Sets or returns the value of the type attribute in an embed element |
width | Sets or returns the value of the width attribute in an embed element |
คุณสมบัติและเหตุการณ์มาตรฐาน
ออบเจ็กต์ Embed ยังสนับสนุนคุณสมบัติและเหตุการณ์ มาตรฐาน อีกด้วย
หน้าที่เกี่ยวข้อง
กวดวิชา HTML: ปลั๊กอิน HTML
อ้างอิง HTML: HTML <embed> แท็ก