-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.html
85 lines (77 loc) · 1.74 KB
/
calculator.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BMI Calculator</title>
<link rel="stylesheet" type="text/css" href="myjs.html">
<style type="text/css">
span
{
font-size: 30px;
margin-left: 150px;
margin-top: 20px;
margin-bottom: 20px;
font-family: algerian;
color: rebeccapurple;
align-content: center;
text-decoration: underline;
}
form
{
height: 20vh;
width: 35%;
backface-visibility: 50%;
background-color: hotpink;
border-radius: 2px solid black;
padding: 10px;
margin-left: 450px;
margin-top: 100px;
border-style: groove;
border-color: blueviolet;
}
label
{
font-size: 20px;
font-family: calibre;
display: inline;
margin-left: 135px;
margin-top: 50px;
padding-top: 50%;
}
button
{
font-size: 15px;
background-color: royalblue;
color: white;
margin-top: 10px;
margin-left: 180px;
width: 30%;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<form >
<span>BMI Calculator</span><br>
<label>Enter Height</label>
<input type="text" name="Height" id="Height">
<br>
<label>Enter Weight</label>
<input type="text" name="Weight" id="Weight">
<br>
<button type="button" id="btn">Submit</button>
</form>
<script >
$(document).ready(function () {
$('#btn').click(function()
{alert( "hello" + $("#Height").val());
var weight = $("#Weight").val();
var height = $("#Height").val();
var bmi = weight / (height * height);
alert("hello" + bmi);
});
});
</script>
</body>
</html>