-
Notifications
You must be signed in to change notification settings - Fork 0
/
project2.html
45 lines (44 loc) · 2.1 KB
/
project2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<title>Temperature converter</title>
<link rel="stylesheet" href="project2.css">
</head>
<body class="main">
<header style="text-align: center; font-style:italic;font-size: 50px; color:rgb(243, 136, 36)">Temperatue Converter</header>
<section id="think">
<div class="inside">
<label style="font-size: 28px;font-style: italic;">Celsius Value: </label>
<input type="number" id="demo2" placeholder="Celsius" oninput="temperature(this.value)" style="font-size: 24px;border-color:gold;"><br><br>
<label style="font-size: 28px;font-style: italic;">Farenheit Value : </label>
<input type="number" id="demo" placeholder="Fahrenheit" oninput="temperature1(this.value)" style="font-size:24px;border-color:gold"><br><br>
<label style="font-size: 28px;font-style: italic;">Kelvin Value : </label>
<input type="number" id="demo1" oninput="temperature2(this.value)"placeholder="Kelvin" style="font-size: 24px;border-color: gold;"><br><br>
<input type="button" value="Clear" onclick="clearvalue()" style="font-size:24px;font-style: italic;margin-left: 225px;color:orange;border-color: gold;">
</div>
</section>
<script>
function temperature(valnum){
valnum=parseFloat(valnum);
demo.value=(9/5*valnum)+32;
demo1.value=273.15+valnum;
}
function temperature1(valnum1){
valnum1=parseFloat(valnum1);
demo2.value=(valnum1-32)*5/9;
demo1.value=((valnum1-32)*5/9)+273.15;
}
function temperature2(valnum2){
valnum2=parseFloat(valnum2);
demo2.value=valnum2-273.15;
demo.value=((valnum2-273.15)*9/5)+32;
}
function clearvalue()
{
demo.value='';
demo1.value='';
demo2.value='';
}
</script>
</body>
</html>