MathMLElement

Baseline 广泛可用 *

此功能已成熟,并且在众多设备和浏览器版本上都能正常工作。自 2023 年 1 月以来,它已在各浏览器中可用。

* 此特性的某些部分可能存在不同级别的支持。

MathMLElement 接口表示任何 MathML 元素。

EventTarget Node Element MathMLElement

实例属性

还继承了其父级 Element 的属性.

MathMLElement.attributeStyleMap 只读

一个 StylePropertyMap,表示元素 style 属性的声明。

MathMLElement.autofocus

页面加载时,或者 <dialog>popover 显示时,控件是否应该获得焦点。

MathMLElement.dataset 只读

一个 DOMStringMap 对象,提供了一系列键/值对,用于命名数据属性,这些属性对应于附加到元素的 自定义数据属性。这些对应于 MathML 的 data-* 全局属性。

MathMLElement.style

一个 CSSStyleDeclaration,表示元素 style 属性的声明。

MathMLElement.tabIndex

元素在制表符顺序中的位置。

实例方法

此接口还继承了其父级 Element 的方法.

MathMLElement.blur()

从当前获得焦点的元素中移除键盘焦点。

MathMLElement.focus()

使元素成为当前的键盘焦点。

示例

MathML

html
<math>
  <msqrt>
    <mi>x</mi>
  </msqrt>
</math>

JavaScript

js
document.querySelector("msqrt").constructor.name; // MathMLElement

规范

规范
MathML Core
# dom-mathmlelement

浏览器兼容性

另见