Aim: Write a JavaScript program to perform find the area of a circle.
<html>
<body>
<h1>Area and circumference of a circle</h1>
Enter the radius for your circle:
<input type="text" id="txtRadius" />
<input type="button" value="Calculate" onClick=CalculateArea() />
<script>
function CalculateArea() {
var radius = document.getElementById('txtRadius').value;
alert("The area of the circle is " + (radius * radius * Math.PI));
}
</script>
</body>
</html>
Output


