Created
February 25, 2010 16:40
-
-
Save tdouce/314704 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>JavaScript Alert Boxes</title> | |
<script language="JavaScript"> | |
function rwhcal(area,precip,eff,capt) | |
{ | |
var area = parseFloat(document.getElementById('txtArea').value); | |
var precip = parseFloat(document.getElementById('txtPrecip').value); | |
var eff = parseFloat(document.getElementById('txtCapt').value); | |
var capt = parseFloat(document.getElementById('txtEff').value); | |
var total = (area*precip*(eff/100)*(capt/100)*0.623); | |
var total_rnd = Math.round(total); | |
alert("You can capture approximately " + total_rnd + " gallons of water off your roof annually!"); | |
} | |
</script> | |
</head> | |
<body> | |
Enter Area: <input type='text' id='txtArea'/><br/> | |
Enter Precip: <input type='text' id='txtPrecip'/><br/> | |
Enter Efficiency: <input type='text' id='txtEff'/><br/> | |
Enter Percent Capture Area: <input type='text' id='txtCapt'/><br/> | |
<input type='button' value='Calculate Rainwater Capture Volume' onclick="rwhcal()"/> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment