Q:

Write the following mathematical expression by using HTML5 MathML

belongs to collection: HTML5 programming Exercises

0

Write the following mathematical expression by using HTML5 MathML

a2 + b2 = c2

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution

HTML5 MathML provides a way to write mathematics on the web page. All mathematical expression are written inside <math> tag. There are many child elements of the math element. Unfortunately, not all browsers support math element. So use the latest mozilla or chrome for render it.

<!DOCTYPE HTML> 
<html> 
<head> 
</head> 
<body>
	<math xmlns="http://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>

Output of the above code

a2 + b2 = c2

Here, mrow is horizontally group sub-expressions, msup is superscript, mi is identifier, mo is operator and mn is numeric literal.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write code using HTML5 Canvas Composition to draw ... >>
<< Write HTML code to draw a rectangle using Canvas a...