-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtividade_5.html
More file actions
25 lines (25 loc) · 968 Bytes
/
Atividade_5.html
File metadata and controls
25 lines (25 loc) · 968 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Atividade 5</title>
<link rel="stylesheet" href="css/atividade.css">
</head>
<body>
<h2>Coloque o comprimento e a largura total de um cômodo para calcular o custo para assentar piso:</h2>
Comprimento: <input type="text" id="com">
Largura: <input type="text" id="lar">
<button onclick="calcular()">Calcular</button><br><br>
<div id="resultado"></div>
</body>
<script>
calcular = () => {
let com = parseFloat(document.getElementById("com").value);
let lar = parseFloat(document.getElementById("lar").value);
let me = com * lar;
document.getElementById("resultado").innerHTML = `O valor total a pagar é R$ ${me * 36}`;
}
</script>
</html>