HTML DOM MenuItem Object
MenuItem Object
วัตถุ MenuItem แสดงถึงองค์ประกอบ HTML <menuitem>
หมายเหตุ:ปัจจุบันองค์ประกอบ <menuitem> รองรับใน Firefox เท่านั้น
เข้าถึง MenuItem Object
คุณสามารถเข้าถึงองค์ประกอบ <menuitem> โดยใช้ getElementById():
var x = document.getElementById("myMenuItem");
สร้างวัตถุ MenuItem
คุณสามารถสร้าง <menuitem> องค์ประกอบโดยใช้ document.createElement() วิธีการ:
var x = document.createElement("MENUITEM");
MenuItem Object Properties
Property | Description |
---|---|
checked | Sets or returns whether the menu item should be checked |
command | Sets or returns the value of the command attribute of the menu item |
default | Sets or returns whether the menu item should be the default command |
disabled | Sets or returns whether the menu item should be disabled |
icon | Sets or returns an image that represents the menu item |
label | Sets or returns the value of the label attribute of the menu item |
radiogroup | Sets or returns the value of the radiogroup attribute of the menu item |
type | Sets or returns the value of the type attribute of the menu item |
คุณสมบัติและเหตุการณ์มาตรฐาน
ออบเจ็กต์ MenuItem ยังสนับสนุนคุณสมบัติและเหตุการณ์ มาตรฐาน อีกด้วย
หน้าที่เกี่ยวข้อง
การอ้างอิง HTML: แท็ก HTML <menuitem>