Skip to content

Instantly share code, notes, and snippets.

@tdouce
Created February 23, 2010 14:56
Show Gist options
  • Save tdouce/312254 to your computer and use it in GitHub Desktop.
Save tdouce/312254 to your computer and use it in GitHub Desktop.
<!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