Created
January 31, 2014 02:21
-
-
Save httpJunkie/8725568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
function write (message) { | |
document.getElementById('message').innerHTML += message + '<br/>'; | |
} | |
function calculateCircumference(diameter){ | |
payload=(diameter * Math.PI).toFixed(3); | |
//corresponds with "Bay" id on div tag | |
document.getElementById("Bay").innerHTML=payload+" - Inches"; | |
} | |
write(calculateCircumference(4).toFixed(3)); | |
</script> | |
<meta name="description" content="Calculate Circumference" /> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body onLoad="calculateCircumference(4);"> | |
<h1>Calculate Circumference</h1> | |
<h3>On Body onLoad</h3> | |
<h3>with diameter of 4 inches</h3> | |
<br /><br /> | |
<div id="Bay">This will be replaced on Body onLoad by PI calculation</div> | |
<br /><br /><p>by.httpJunkie</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment