-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html.html
More file actions
80 lines (66 loc) · 1.32 KB
/
index.html.html
File metadata and controls
80 lines (66 loc) · 1.32 KB
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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>My Dolars</title>
</head>
<body>
<img src="./my-dolar.gif"/>
<h1>My Dolars</h1>
<div>
<input id="input-real" type="number" placeholder= 'Valor em Reais'>
<input id= "input-dolar"placeholder="Valor do Dólar">
<p id='dolares'>$</p>
<button onclick='calcularDolar()'>Converter</button>
</div>
</body>
<style>
body{
background-color: #323232;
text-align:center;
}
img{
width: 70%;
}
h1{
color: #cfff00;
font-size: 50px;
}
input{
width: 140px;
height: 30px;
}
#input-real{
border: 3px solid #cfff00;
}
#input-dolar{
border: 3px solid red;
}
p{
font-weight: bold;
font-size: 25px;
}
button{
height: 40px;
width: 150px;
font-size: 20px;
cursor: pointer;
border:3px solid #cfff00;
border-radius: 10px;
background-color: #323232;
color:white
}
button:hover{
color: #323232;
background-color: #cfff00;
}
</style>
<script>
function calcularDolar (){
let real = document.getElementById("input-real").value
let dolar = document .getElementById("input-dolar").value
let resultado = real / dolar
dolares.innerHTML= '$'+ resultado
alert ('O resultado é $'+ resultado + 'dólares')
}
</script>
</html>