Calculate circle area/Peri/Calculate sphere volume
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> function calcArea(){ inpRadius = 3; alert(Math.PI * ((inpRadius)*(inpRadius))); } function calcPeri() { inpRadius = 3; alert(2 * Math.PI * (inpRadius)); } function calcVol() { inpRadius = 3; alert(Math.PI * ((inpRadius)*(inpRadius)*(inpRadius)) * (4/3)); } </script> </head> <body> <input type="button" value="Calculate circle area" onclick="calcArea();"> <input type="button" value="Calculate circle Peri" onclick="calcPeri();"> <input type="button" value="Calculate sphere volume" onclick="calcVol();"> </body> </html>