forked from MateusAugustoFerreira/exercicio-js-turma-tarde
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
<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>calculadora shernows</title> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> | ||
<script> | ||
|
||
|
||
let a | ||
let b | ||
let resultado; | ||
let operacao = "soma"; | ||
|
||
switch (operacao) { | ||
case "soma": | ||
resultado = a+b; | ||
break; | ||
case "subtracao": | ||
resultado = a-b; | ||
break; | ||
case "multiplicao": | ||
resultado = a*b; | ||
break; | ||
case "divisao": | ||
resultado = a/b; | ||
default: | ||
break; | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!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"> | ||
<style> | ||
#container { | ||
background-color: blue; | ||
color: white; | ||
width: 100%; | ||
line-height: 70px; | ||
height: 70px; | ||
text-align: center; | ||
|
||
} | ||
</style> | ||
<title>Eventos teste</title> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<div id="container"> | ||
ol | ||
</div> | ||
<h1>JS</h1> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
|
||
<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>exercicios</title> | ||
</head> | ||
|
||
<body> | ||
<div> | ||
<input id="a" type="number" placeholder="digite um numero"> | ||
<input id="b" type="number" placeholder="digite um numero"> | ||
<input id="soma" type="button" name="somar" onclick="clicar()"> | ||
</div> | ||
<div id="resp">resposta:</div> | ||
</body> | ||
|
||
</html> | ||
<script> | ||
|
||
|
||
function clicar() { | ||
var resp = document.getElementById("resp") | ||
var num1 = document.getElementById('a') | ||
var num2 = document.getElementById('b') | ||
var input1 = Number(num1.value) | ||
var input2 = Number(num2.value) | ||
// console.log(input2); | ||
resp = input1 + input2; | ||
document.getElementById('resp').innerText = resp | ||
} | ||
|
||
// function somar() { | ||
// let num1 = document.getElementById("input1") | ||
// let num2 = document.getElementById("input2") | ||
// let result = 0; | ||
// let n1 = Number(num1.value); | ||
// let n2 = Number(num2.value); | ||
// result = n1 + n2; | ||
// document.getElementById("result").innerText = ` O resultado da soma entre ${n1} e ${n2} é: ${result} `; | ||
// } | ||
</script> |