JavaScript Source Code 3000: Calculators: Expression Solver
Expression Solver
Just enter a math expression (with +, -, *, and / signs) and this script will evaluate the expression for you. Who needs a calculator when you have JavaScript. ;-)
Enter a math expression and click "Calculate" !
Equation
Result
JavaScript Source Code 3000: Calculators: Expression Solver:
Simply click inside the window below, use your cursor to highlight the
script, and copy (type Control-c or Apple-c) the script into a new file in
your text editor (such as Note Pad or Simple Text) and save (Control-s or
Apple-s). The script is yours!!!
<!-- TWO STEPS TO INSTALL EXPRESSION SOLVER:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<SCRIPT LANGUAGE="JavaScript">
<! >
<! >
<!-- Begin
function calc(form) {
form.result.value=eval(form.expr.value);
}
// End -->
</SCRIPT>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<center>
<i>Enter a math expression and click "Calculate" !</i>
<br>
<br>
<form>
<table border=3 cellspacing=2 cellpadding=5>
<tr>
<td align=center><i>Equation</i></td>
<td align=center><i>Result</i></td>
</tr>
<tr>
<td align=center><input type=text name=expr size=15></td>
<td align=center><input type=text name=result size=15></td>
</tr>
<tr>
<td colspan=2 align=center><input type=button value="Calculate!" onclick="calc(this.form)"></td>
</tr>
</table>
</form>
</center>
<!-- Script Size: 1.09 KB -->
Wyszukiwarka
Podobne podstrony:
language expressionsgram loc expreshowto express likes script(ebook ITA NARR) Christie, Agatha Assassinio sull Orient Express (TXT)21 10 2011 expression écritwięcej podobnych podstron