YouTip LogoYouTip

Dom Obj Menuitem

# HTML DOM MenuItem Object * * * ## MenuItem Object The MenuItem object is new in HTML5. The MenuItem object represents an HTML `` element. **Note:** Currently, only the Firefox browser supports the `` element. ### Accessing a MenuItem Object You can use `getElementById()` to access a `` element: ```javascript var x = document.getElementById("myMenuItem"); ### Creating a MenuItem Object You can use the `document.createElement()` method to create a `` element: ```javascript var x = document.createElement("MENUITEM"); ## MenuItem Object Properties | Property | Description | | --- | --- | | checked | Sets or returns whether a menu item should be checked. | | command | Sets or returns the value of the menu item's command attribute. | | default | Sets or returns whether the menu item should be the default command. | | disabled | Sets or returns whether the menu item is disabled. | | icon | Sets or returns the image representing the menu item. | | label | Sets or returns the value of the menu item's label attribute. | | radiogroup | Sets or returns the value of the menu item's radiogroup attribute. | | type | Sets or returns the value of the menu item's type attribute. | ## Standard Properties and Events The MenuItem object also supports standard (#) and (#). * * * ## Related Articles HTML Reference: [HTML `` tag](#) [](#)(#) (#)[](#) [Volcengine Coding Plan supports mainstream large models like Doubao, GLM, DeepSeek, Kimi, MiniMax, officially supplied, stable and reliable. Configuration Guide Β₯9.9/month Subscribe Now](https://maas.xfyun.cn/modelSquare?ch=maas_lm_l2E)
← Ruby Object OrientedDom Obj Menu β†’