0% found this document useful (0 votes)
33 views3 pages

Practical - 9

Uploaded by

rsmuiscool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views3 pages

Practical - 9

Uploaded by

rsmuiscool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Shri Pramod Patil (SPPAC) Junior College

Name : PATHADE MEDHAVI MAHESH


Std : 12th Div : A
Roll No : 12118
Practical No : 9 Date :
Practical Name : Create event driven JavaScript program to convert temperature to
and from Celsius, Fahrenheit.

Code for temp.html

<!DOCTYPE html>
<html>
<head>
<title>Temperature</title>
</head>
<body>
<script type="text/javascript">
function get_Fahrenheit()
{
var c = parseInt(document.getElementById('c1').value);
var f;
f = c/5*(9)+32;
var g = parseInt(document.getElementById('f1').value);
var h;
h = ((g-32)/9)*5;
document.getElementById("demo").innerHTML = "Fahrenheit : "+f+"<br>Celsius :
"+h;
}
</script>
Temperature in Celsius = <input type="text" id="c1"><br><br>
Temperature in Fahrenheit = <input type="text" id="f1"><br><br>
<input type="submit" onclick="get_Fahrenheit()">
<div id="demo"></div>
</body>
</html>
Output

You might also like