| free hosting image hosting hosting reseller online album e-shop famous people | ||
![]() ![]() |
||
Imperial - square inches, feet, miles, acres
Metric - square centimetres, metres, kilometres, hectares
And this goes into the body section:
Clicking the Calculate button passes the user's input value to the function convert():areainput - where you place your conversion number
from - the first dropdown menu
to - the second dropdown menu
calculate - the Calculate button
result - the Result box
onClick="convert(Form1.areainput.value)"First, all dropdown options are scanned to see which option is selected, and:
When you input a number, its value is assigned to variable ainput.the from option value is assigned to the variable unita
the to option value is assigned to variable unitb
if (unita=="square inches")where:
{
if (unitb=="square feet")
{
result = invalue/Math.pow(12,2)
}
}
So if you enter 288 square inches, that value is divided by 144 to give you 2 square feet.invalue is the user input value
Math.pow(12,2) is 12 raised to the power of 2 - ie: 12 x 12 =144
result is the value passed to the Result box