HTML5 MathML

HTML5 MathML <merror> Tag

The <merror> tag displays the contents of an error message, typically emitted by a MathML processor when it cannot interpret markup. It renders its children with an error style (often a red box).


Definition and usage

The <merror> element is a container for a message that highlights a syntax or processing error in a formula. Authoring tools and preprocessors wrap invalid input in <merror> so the reader sees something went wrong instead of a silently broken equation.

Syntax

<merror>
  <mtext>error message</mtext>
</merror>

Example

Showing a processor error inline
<math>
  <merror>
    <mtext>Syntax error: unexpected token</mtext>
  </merror>
</math>

The message inside <merror> is displayed with a distinct, usually boxed and coloured, appearance so it stands out from valid mathematics.

ℹ️

As part of MathML Core, <merror> is supported by modern browsers. It is mainly generated by tools rather than hand-written by authors.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships