HTMLMenuElement

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

HTMLMenuElement 接口提供额外的属性(除了从 HTMLElement 接口继承的属性之外),用于操作 <menu> 元素。<menu><ul> 元素的语义替代。

EventTarget Node Element HTMLElement HTMLMenuElement

实例属性

从其父接口 HTMLElement,和它的祖先继承属性。

HTMLMenuElement.compact 已弃用

一个布尔值,用于确定菜单是否紧凑地显示。

实例方法

从其父接口 HTMLElement,和它的祖先继承方法。

HTMLMenuElement 没有实现特定的方法。

规范

Specification
HTML
# htmlmenuelement

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
HTMLMenuElement
compact
Deprecated

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Deprecated. Not for use in new websites.