Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. MathML
  3. Reference
  4. Elements
  5. <maction>

<maction>

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see thecompatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The<maction>MathML element allows to bind actions to mathematical expressions. By default, only the first child is rendered but some browsers may take into accountactiontype andselection attributes to implement custom behaviors.

Note:Historically, this element provided a mechanism to make MathML formulas interactive. Nowadays, it is recommended to rely onJavaScript and other Web technologies to implement this use case.

Attributes

This element's attributes include theglobal MathML attributes as well as the following attributes:

actiontypeDeprecatedNon-standard

The action which specifies what happens for this element. Special behaviorfor the following values were implemented by some browsers:

  • statusline: If there is a click on theexpression or the reader moves the pointer over it, themessage is sent to the browser's status line. The syntax is:<maction actiontype="statusline"> expression message </maction>.
  • toggle: When there is a click on the subexpression, the rendering alternates the display of selected subexpressions. Therefore each click increments theselection value.The syntax is:<maction actiontype="toggle" selection="positive-integer" > expression1 expression2 expressionN </maction>.
selectionDeprecatedNon-standard

The child element currently visible, only taken into account foractiontype="toggle" or non-standardactiontype values. The default value is1, which is the first child element.

Examples

The following example uses the "toggle"actiontype:

html,body {  height: 100%;}body {  display: grid;  place-content: center;}math {  font-size: 1.5em;}maction {  padding: 0.5em;  cursor: pointer;}
html
<p>Try clicking this formula several times:</p><math display="block">  <maction actiontype="toggle">    <mfrac>      <mn>6</mn>      <mn>8</mn>    </mfrac>    <mfrac>      <mrow>        <mn>3</mn>        <mo>×</mo>        <mn>2</mn>      </mrow>      <mrow>        <mn>4</mn>        <mo>×</mo>        <mn>2</mn>      </mrow>    </mfrac>    <mfrac>      <mn>3</mn>      <mn>4</mn>    </mfrac>  </maction></math>

Sample rendering:

MathML toggle action example

Rendering in your browser:

Technical summary

Implicit ARIA role None

Specifications

Specification
MathML Core
# dfn-maction

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp