Created
February 23, 2010 14:56
-
-
Save tdouce/312254 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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<HTML> | |
<HEAD> | |
<script language="javascript" type="text/javascript"> | |
function calculate(){ | |
var area = parseFloat(document.getElementById('input_area').value; | |
var precip = parseFloat(document.getElementById('input_precip').value | |
var total = area * precip; | |
} | |
function addtext() { | |
var newtext = total; | |
document.getElementById('outputtext').value = newtext; | |
} | |
</script> | |
</HEAD> | |
<BODY> | |
<form name="myform"> | |
Area: <input type='text' id="input_area"/><br/> | |
Precip: <input type='text' id="inpu_precip"/><br/> | |
<input type="button" value="Calculate" onClick="addtext();"/><br/> | |
Result: <input type='text' id="outputtext"/> | |
</form> | |
</BODY> | |
</HTML> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment