Script Categories













Calculators >>> Circumference.

JavaScript can help you figure the circumference of a circle when you enter the radius.

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
function calculate() {
var radius=prompt("Please enter the size of the radius","");
var pi=3.14159265359;  // estimated to 11 decimal places
var circ=2*pi*radius;
var d=alert("The circumference of a circle with radius "+radius+" is "+circ+".")
}
// End -->
</script>
<form>
<input
type=button value="Calculate Circumference" onClick="calculate()">
</form>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).

R7


©