0% found this document useful (0 votes)
3 views1 page

Practical 11

This document is an HTML page containing a JavaScript program that converts temperatures between Celsius and Fahrenheit. It includes input fields for users to enter temperature values, which triggers the conversion function on input. The page features a simple design with a background color and instructions for use.

Uploaded by

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

Practical 11

This document is an HTML page containing a JavaScript program that converts temperatures between Celsius and Fahrenheit. It includes input fields for users to enter temperature values, which triggers the conversion function on input. The page features a simple design with a background color and instructions for use.

Uploaded by

patilchirayu809
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Practical 11

<!DOCTYPE html>

<html>

<body bgcolor="#31DBE3">

<h1>JavaScript program to convert Temperature to and from Celcius, Fahrenhet</h1>

<h2>Insert a number into one of the input fields below:</h2>

<b>Degrees Celsius : <input type="number" id="c" oninput="convert('C')"> <br><br>

<b>Degrees Fahrenheit : <input type="number" id="f" oninput="convert('F')"> <br><br>

<p style="color:yellow;font-size:20pt"> Inserting values in any one of the textbox, it shows the conversion
of temperature to and from Celcius, Fahrenhet</p>

<script>

function convert(degree)
{
var x;
if(degree=="C")
{
x=[Link]("c").value * 9 / 5 + 32;
[Link]("f").value=x;
}
else
{
x=([Link]("f").value -32) * 5 / 9;
[Link]("c").value=x;
}
}

</script>

</body>

</html>

**************

You might also like