HTML-DOM -MenuItem- Objekt
MenuItem-Objekt
Das MenuItem-Objekt repräsentiert ein HTML-<menuitem>-Element.
Hinweis: Das Element <menuitem> wird derzeit NUR in Firefox unterstützt.
Greifen Sie auf ein MenuItem-Objekt zu
Sie können auf ein <menuitem>-Element zugreifen, indem Sie getElementById() verwenden:
var x = document.getElementById("myMenuItem");
Erstellen Sie ein MenuItem-Objekt
Sie können ein <menuitem>-Element erstellen, indem Sie die Methode document.createElement() verwenden:
var x = document.createElement("MENUITEM");
MenuItem-Objekteigenschaften
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 |
Standardeigenschaften und -ereignisse
Das MenuItem-Objekt unterstützt auch die Standardeigenschaften und -ereignisse .
Verwandte Seiten
HTML-Referenz: HTML-<menuitem>-Tag