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>
**************