»
EnglishFrenchVietnamese

Print - Area Calculator - JavaScriptBank.com

Full version: jsB@nk » Calculation » Math » Area Calculator
URL: https://www.javascriptbank.com/dtcreations-area-calculator.html

Area Calculator © JavaScriptBank.comPut a calculator code on your page that can tell a visitor the area units of a Rectangle, Triangle, Parallelogram, aTrapezium or a Circle.

Full version: jsB@nk » Calculation » Math » Area Calculator
URL: https://www.javascriptbank.com/dtcreations-area-calculator.html



CSS
<style type="text/css"><!--A:link {COLOR: #0000FF; TEXT-DECORATION: none}A:visited {COLOR: #0000FF; TEXT-DECORATION: none}A:hover {COLOR: #0000FF; TEXT-DECORATION: underline}A:active {COLOR: #0000FF; TEXT-DECORATION: none}--></style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script language="JavaScript">//E-Mail: dtcreationsuk@yahoo.comfunction Rectangle(form) {RectangleResult = form.RecLength.value * form.RecWidth.valueif (RectangleResult == 0) {document.all.RecT.innerText = "Invalid";} else {document.all.RecT.innerText = "The area of your rectangle is "+RectangleResult+" cm². This is worked out by "+form.RecLength.value+" x "+form.RecWidth.value;}}function Triangle(form) {TriangleResult = 0.5 * form.TriBase.value * form.TriHeight.valueif (TriangleResult == 0) {document.all.TriV.innerText = "Invalid";} else {document.all.TriV.innerText = "The area of your triangle is "+TriangleResult+" cm².  This is worked out by 0.5 x "+form.TriBase.value+" x "+form.TriHeight.value;}}function Parallelogram(form) {ParallelogramResult = form.ParBase.value * form.ParHeight.valueif (ParallelogramResult == 0) {document.all.ParV.innerText = "Invalid";} else {document.all.ParV.innerText = "The area of your parallelogram is "+ParallelogramResult+" cm².  This is worked out by "+form.ParBase.value+" x "+form.ParHeight.value;}}function Trapezium(form) {TrapeziumResult = 0.5 * (form.TraSideA.value * form.TraSideB.value) * form.TraHeight.valueif (TrapeziumResult == 0) {document.all.TraV.innerText = "Invalid";} else {document.all.TraV.innerText = "The area of your trapezium is "+TrapeziumResult+" cm².  This is worked out by 0.5 x ("+form.TraSideA.value+" x "+form.TraSideB.value+") x "+form.TraHeight.value;}}function Circle(form) {CircleResult = 3.142 * form.CirRadius.value * form.CirRadius.valueif (CircleResult == 0) {document.all.CirV.innerText = "Invalid";} else {document.all.CirV.innerText = "The area of your circle is "+CircleResult+" cm².  This is worked out by 3.142 x "+form.CirRadius.value+" x "+form.CirRadius.value;}}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<table width="600" border="0" cellspacing="0" cellpadding="1">  <tbody><tr>     <td><hr align="left" width="600" size="1" color="#0066FF"></td>  </tr></tbody></table><table width="600" border="0" cellspacing="0" cellpadding="0">  <tbody><tr>    <td><form>        <h1 align="left"><font color="#ff0000" size="4" face="Arial">Rectangle</font></h1>        <font face="Arial" size="2"> Enter the length of the rectangle         <input type="text" name="RecLength" size="20">        cm<br>        Enter the width of the rectangle         <input type="text" name="RecWidth" size="20">        cm<br>        <input name="button" type="button" onclick="Rectangle(this.form)" value="Find Area">        <br>        <br>        <font color="#ff0000" size="2" id="RecT"><font color="#0000ff" size="2">Press &#39;Find Area&#39; for the area of your rectangle to be calculated </font></font></font>         <h1><font color="#ff0000" size="4" face="Arial">Triangle</font></h1>        <p><font face="Arial" size="2"> Enter the length of the base           <input type="text" name="TriBase" size="20">          cm<br>          Enter the vertical height of the triangle           <input type="text" name="TriHeight" size="20">          cm </font><font face="Arial" size="2"><br>          <input name="button" type="button" onclick="Triangle(this.form)" value="Find Area">          <br>          <br>          <font color="#ff0000" size="2" id="TriV"><font color="#0000ff" size="2">Press &#39;Find Area&#39; for the area of your triangle to be calculated</font></font><br>          </font></p>        <font face="Arial" size="2"> </font>         <h1><font color="#ff0000" size="4" face="Arial">Parallelogram</font></h1>        <p><font face="Arial" size="2"> Enter the length of the base           <input type="text" name="ParBase" size="20">          cm<br>          Enter the vertical height of the parallelogram           <input type="text" name="ParHeight" size="20">          cm<br>          <input name="button" type="button" onclick="Parallelogram(this.form)" value="Find Area">          <br>          </font><br>          <font color="#ff0000" size="2" id="ParV" face="Arial"><font color="#0000ff" size="2" face="Arial">Press &#39;Find Area&#39; for the area of your parallelogram to be calculated</font><font color="#0000ff" size="2"><br>          </font></font> </p>        <h1><font color="#ff0000" size="4" face="Arial">Trapezium</font></h1>        <div align="left">           <p><font face="Arial" size="2"> Enter the length of the top side             <input type="text" name="TraSideA" size="20">            cm<br>            Enter the length of the bottom side             <input type="text" name="TraSideB" size="20">            cm<br>            Enter the height of the trapezium             <input type="text" name="TraHeight" size="20">            cm<br>            <input name="button" type="button" onclick="Trapezium(this.form)" value="Find Area">            <br>            <br>            <font color="#ff0000" size="2" id="TraV" face="Arial"><font color="#0000ff" size="2" face="Arial">Press &#39;Find Area&#39; for the area of your trapezium to be calculated<br>            </font></font></font></p>          <h1><font color="#ff0000" size="4" face="Arial">Circle</font></h1>          <div align="left">             <p><font face="Arial" size="2"> Enter the radius of the circle               <input type="text" name="CirRadius" size="20">              cm<br>              <input name="button" type="button" onclick="Circle(this.form)" value="Find Area">              <br>              <br>              <font color="#ff0000" size="2" id="CirV" face="Arial"><font color="#0000ff" size="2" face="Arial">Press &#39;Find Area&#39; for the area of your circle to be calculated</font></font></font></p>          </div>        </div>        <blockquote>           <div align="center"><font face="Arial" size="2">             <input type="reset" name="Reset" value="Click Here To Reset All">            </font></div>        </blockquote>        <div align="left">           <p align="center"><font face="Arial" size="2"> </font> </p>        </div>      </form>    </td>  </tr></tbody></table><table width="600" border="0" cellspacing="0" cellpadding="1">  <tbody><tr>     <td><hr align="left" width="600" size="1" color="#0066FF"></td>  </tr></tbody></table><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->