Difference between revisions of "Centigrade/Farenheit converter"

From Wikiid
Jump to: navigation, search
(New page: <SCRIPT LANGUAGE="JavaScript"><nowiki> function convertCtoF() { var centy=0; centy=document.Converter.centigrade.value; document.Converter.fahrenheit.value= centy *9/5+32 ; } function co...)
 
Line 3: Line 3:
 
function convertCtoF() { var centy=0; centy=document.Converter.centigrade.value; document.Converter.fahrenheit.value=  centy *9/5+32 ; }
 
function convertCtoF() { var centy=0; centy=document.Converter.centigrade.value; document.Converter.fahrenheit.value=  centy *9/5+32 ; }
 
function convertFtoC() { var centy=0; centy=document.Converter.fahrenheit.value; document.Converter.centigrade.value= (centy-32)*5/9 ; }
 
function convertFtoC() { var centy=0; centy=document.Converter.fahrenheit.value; document.Converter.centigrade.value= (centy-32)*5/9 ; }
 +
 +
function main() { document.write ("Hello") ; }
  
 
</nowiki></SCRIPT>
 
</nowiki></SCRIPT>
Line 8: Line 10:
 
<form name="Converter">
 
<form name="Converter">
 
; Centigrade : <input type=text name="centigrade" size=10 onchange="convertCtoF()">
 
; Centigrade : <input type=text name="centigrade" size=10 onchange="convertCtoF()">
; Farenheit  : <input type=text name="fahrenheit" size=10 onchange="convertFtoC()">
+
; Farenheit  : <input type=text name="fahrenheit" size=10 onchange="convertFtoC()" onload="main()">
 
</form>
 
</form>

Revision as of 19:09, 23 November 2007

<SCRIPT LANGUAGE="JavaScript"> function convertCtoF() { var centy=0; centy=document.Converter.centigrade.value; document.Converter.fahrenheit.value= centy *9/5+32 ; } function convertFtoC() { var centy=0; centy=document.Converter.fahrenheit.value; document.Converter.centigrade.value= (centy-32)*5/9 ; } function main() { document.write ("Hello") ; } </SCRIPT>

<form name="Converter">

Centigrade 
<input type=text name="centigrade" size=10 onchange="convertCtoF()">
Farenheit  
<input type=text name="fahrenheit" size=10 onchange="convertFtoC()" onload="main()">

</form>