Search This Blog

Thursday, 6 September 2012

Practical-7) Write a JavaScript to convert Celsius to Fahrenheit.


Filename-js7.html

<html>
<head>
          <script language="javascript">
                   function cel()
                   {
                             frm.farn.value=((9/5)*(parseInt(frm.cell.value)))+32;
                   }
          </script>
</head>
<body>
          <form name="frm">
                   Enter Celsius
                   <input type="text" name="cell"/>
                   <input type="button" name="far" value="Fahrenheit"onClick="cel()"/>
                   <input type="text" name="farn" readonly="readonly"/>
          </form>
</body>
</html>

Output

Enter Celsius   

No comments:

Post a Comment