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
1 changed file
with
23 additions
and
20 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 |
---|---|---|
@@ -1,37 +1,40 @@ | ||
<!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"> | ||
<style> | ||
body { | ||
/* body { | ||
background-color: rgb(50, 45, 113); | ||
color: rgb(0, 0, 0); | ||
} | ||
} */ | ||
</style> | ||
<title>Aula sobre DOM</title> | ||
</head> | ||
|
||
<body> | ||
<h1>JS</h1> | ||
<p id="result">Resultado 1</p> | ||
<p></p> | ||
<div>Teste DIV</div> | ||
</body> | ||
</html> | ||
<h1>Verificação de idade</h1> | ||
|
||
<script> | ||
//----------------------------------------------------------// | ||
let divIdade = window.document.getElementsByTagName("div")[0] | ||
<script> | ||
|
||
|
||
if (idade<=18) { | ||
document.body.style.background = "black"; | ||
document.body.style.color | ||
} else { | ||
// const result = document.querySelector("<p>") | ||
var idade = prompt("digite sua idade"); | ||
|
||
} | ||
|
||
//chamada da função, (não terminado, tera que ser passado dnv) | ||
if (idade >= 18) { | ||
document.body.style.background = "black"; | ||
document.body.style.color = "silver"; | ||
document.write("você é maior de idade"); | ||
} else { | ||
(idade <18) | ||
document.body.style.background = "red"; | ||
document.body.style.color = "white"; | ||
document.write("você é menor de idade"); | ||
|
||
} | ||
|
||
</script> | ||
</body> | ||
|
||
</script> | ||
</html> |