HTML DOM MenuItem Object
Đối tượng MenuItem
Đối tượng MenuItem đại diện cho một phần tử HTML <menuitem>.
Lưu ý: Phần tử <menuitem> hiện CHỈ được hỗ trợ trong Firefox.
Truy cập một đối tượng MenuItem
Bạn có thể truy cập phần tử <menuitem> bằng cách sử dụng getElementById ():
var x = document.getElementById("myMenuItem");
Tạo một đối tượng MenuItem
Bạn có thể tạo một phần tử <menuitem> bằng cách sử dụng phương thức document.createElement ():
var x = document.createElement("MENUITEM");
Thuộc tính đối tượng MenuItem
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 |
Thuộc tính và sự kiện tiêu chuẩn
Đối tượng MenuItem cũng hỗ trợ các thuộc tính và sự kiện tiêu chuẩn .
Các trang liên quan
Tham chiếu HTML: thẻ HTML <menuitem>