Computer >> Computer tutorials >  >> Programming >> Javascript

Example of MathML in HTML5


The HTML syntax of HTML5 allows forMathML elements to be used inside a document using <math>...</math> tags.

Most of the web browsers can display MathML tags. If your browser does not support MathML, then I would suggest you use the latest version of Firefox.

Let us see an example:

<!doctype html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>Pythagorean theorem</title>
   </head>
   <body>
      <math xmlns="https://www.w3.org/1998/Math/MathML">
         <mrow>
            <msup><mi>a</mi><mn>2</mn></msup>
            <mo>+</mo>
            <msup><mi>b</mi><mn>2</mn></msup>
            <mo>=</mo>
            <msup><mi>c</mi><mn>2</mn></msup>
         </mrow>
      </math>
   </body>
</html>