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

瀏覽器相容性

另見