-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
72 lines (68 loc) · 2.76 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Multicultural Weight converting with Jacob</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<style>
body{
margin-top:70px;
margin-left:450px;
background:#333;
color:#fff;
}
</style>
</head>
<body>
<div class="container"><!-- .container in emmit -->
<div class="row">
<div class="col-md-6">
<h1 class="display-4 text-center">Multicultural Weight converting with <a href='#'>Jacob</a> <i class="fas fa-balance-scale"></i></h1>
<form >
<div class="card bg-success mb-2">
<div class="form-group">
<label><h4>Pounds:</h4></label>
<input type="number"
id="input"
class="form-control form-control-lg"
placeholder="Enter Pounds...">
</div>
</div>
</form>
<div id="output">
<div class="card bg-primary mb-2"><!-- mb- means margin bottom in bootstrap -->
<div class="card-block">
<h4>Grams :</h4>
<div id="gramsOut"></div>
</div>
</div>
<div class="card bg-secondary mb-2">
<div class="card-block">
<h4>Kilograms :</h4>
<div id="kilogramsOut"></div>
</div>
</div>
<div class="card bg-danger mb-2">
<div class="card-block">
<h4>Onunces :</h4>
<div id="ouncesOut">
</div>
</div>
</div>
</div>
</div>
</div>
<script>
document.getElementById('input').addEventListener('input',function(e){
let pounds = e.target.value;
console.log(pounds)
document.getElementById('gramsOut').innerHTML = pounds/0.0022046;
document.getElementById('kilogramsOut').innerHTML = pounds/2.2046;
document.getElementById('ouncesOut').innerHTML = pounds*16;
})
</script>
</body>
</html>