Do calculation in document.write : write : Document JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Document » write »

 

Do calculation in document.write

















<html>
<head>
<title>Find the area and circumference of a circle</title>
<script type="text/javascript" language="javascript">
<!-- //
function FindArea(){
    var number = new Number(123);
    document.write("<P>You entered a radius of " + number + "</p>");
    document.write("<P>The area of the circle is " (number * number * Math.PI"</p>");
    document.write("<P>The circumference of the circle is " (* number * Math.PI"</p>");
}
// -->
</script>
</head>
<body onload="FindArea()">

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Document
» write