Percentage Calculator

Percentage Calculator
What is % of ? Answer: 
is what percent of ? Answer: %





Put this between your HEAD-tags
<script language=JavaScript>
<!--
//Script by Tom Richardson Jr.
//If you have any questions, e-mail me at gooftroop@geocities.com
//or visit mt web site at http://home.rmci.net/gooftroop

function perc1() {
a = document.form1.a.value/100;
b = a*document.form1.b.value;
document.form1.total1.value = b
}
function perc2() {
a = document.form1.c.value;
b = document.form1.d.value;
c = a/b;
d = c*100;
document.form1.total2.value = d
}
//-->
</script>


Put this between your BODY-tags
<form name=form1>
<table BORDER=0 BGCOLOR="#225485" cellspacing=5><tr>
<td ALIGN=CENTER COLSPAN="3">
<font face=arial size=+1 color="#FFFFFF">Percentage Calculator</font>
</td></tr><tr><td>
<font color="#FFFFFF"><font size=-1>What is 
<input size=5 name=a>% of <input size=5 name=b>?
</font></font></td><td>
<font color="#FFFFFF"><font size=-1>Answer: 
</font></font><input maxLength=40 size=5 name=total1>
</td><td>
<input onclick=perc1() type=button value=Calculate>
</td></tr><tr><td>
<input size=5 name=c><font color="#FFFFFF"><font size=-1>
is what percent of <input size=5 name=d>?
</font></font></td><td>
<font color="#FFFFFF"><font size=-1>
Answer: <input size=5 name=total2>%
</font></font></td><td>
<input onclick=perc2() type=button value=Calculate>
</td></tr><tr><td ALIGN=CENTER COLSPAN="3">
<input type=reset value=Reset>
</td></tr></table></form>

Free JavaScripts provided
by Winfolinx.com




Back