Open In App

HTML5 MathML <merror> Tag

Last Updated : 07 Jul, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML5 MathML <merror> tag tag is an inbuilt element in HTML5 which is used to wrap the expression in a box, makes that expression eye-catching. This tag is used to display the error message. Normally it alone can’t just pop out when your MathML markup is wrong or any kind of error occurs, you will get an XML parsing. 

Syntax: 

<merror> child elements </merror>

Attributes: This tag accepts some attributes which are listed below: 

  • class|id|style: This attribute is used to hold the styles of the child elements.
  • href: This attribute used to hold any hyperlink to a specified URL.
  • mathbackground: This attribute holds the value of the math expressions background color.
  • mathcolor: This attribute holds the color of the math expressions.

Below example will illustrates the concept of HTML5 <merror> tag:

Example: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML5 MathML merror tag</title>
</head>
 
<body style="text-align:center;">
 
    <h1 style="color:green">GeeksforGeeks</h1>
    <h3>HTML5 MathML merror tag</h3>
 
    <math>
        <merror mathbackground="yellow">
            <mtext mathcolor="red">
                Pythagoras Equation:
            </mtext>
            <mrow>
                <msup>
                    <mi> x </mi>
                    <mn>2 </mn>
                </msup>
                <mo>-</mo>
                <msup>
                    <mi> y </mi>
                    <mn>2 </mn>
                </msup>
            </mrow>
            <mo>=</mo>
            <msup>
                <mi> z </mi>
                <mn>2 </mn>
            </msup>
        </merror>
    </math>
    <p>
        This tag is use to display the
        error in any expression
    </p>
</body>
 
</html>


Output:

Screenshot-from-2023-07-06-14-34-51

Supported Browsers: The browsers are supported by HTML5 MathML <merror> tag are listed below: 

  • Firefox
  • Safari


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads