<html> <head> <title>Circle</title> <script> function findArea() { var radBox = document.getElementById("input1") var r = parseFloat(radBox.value) var area = 3/14 * r * r var divResult = document.getElementById("result") divResult.innerHTML = "AREA = "+area } </script> </head> <body> <input type="text" placeholder="Enter radius" id="input1"/> </br> <input type="button" value="Area" id="button1" onclick="findArea()"/> <input type="button" value="Perimeter" id="button2"/> <br> <!-- Area = 3.14 * r * r--> <!-- Perimeter = 2 * 3.14 * r--> <div id="result"> area = 0 </div> </body> </html>
Office no.- 401,Shekhar Central Building ,Palasiya, Pin-code:452001, Indore
contact@codebetter.in
+91 88230 75444, +91 99939 28766