From e7795b8e41f1026ae6ac4b39bb7b4dd49a4fd53e Mon Sep 17 00:00:00 2001 From: Audry-prog Date: Tue, 22 Sep 2020 22:55:29 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Ecerc=C3=ADcio=201=20de=20Javascript=20reso?= =?UTF-8?q?lvido?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercicios/aula1/exercicio_javascript.js | 10 ++++++++++ aulas-javascript/exercicios/aula1/index.html | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 aulas-javascript/exercicios/aula1/exercicio_javascript.js diff --git a/aulas-javascript/exercicios/aula1/exercicio_javascript.js b/aulas-javascript/exercicios/aula1/exercicio_javascript.js new file mode 100644 index 0000000..f050db1 --- /dev/null +++ b/aulas-javascript/exercicios/aula1/exercicio_javascript.js @@ -0,0 +1,10 @@ + function checarSePodeDirigir(idade){ + + if (idade >= 18) { + alert('Já pode dirigir!'); + } else { + alert('Ainda não pode dirigir!'); + } + } + + checarSePodeDirigir(16); \ No newline at end of file diff --git a/aulas-javascript/exercicios/aula1/index.html b/aulas-javascript/exercicios/aula1/index.html index e69de29..c2a20de 100644 --- a/aulas-javascript/exercicios/aula1/index.html +++ b/aulas-javascript/exercicios/aula1/index.html @@ -0,0 +1,13 @@ + + + + + + + Exemplo de JavaScript Externo + + + + + + \ No newline at end of file From 22fb200a79f2da45c17b86826eefb28cacc3b767 Mon Sep 17 00:00:00 2001 From: Audry-prog Date: Tue, 29 Sep 2020 11:37:45 -0300 Subject: [PATCH 2/2] =?UTF-8?q?Exerc=C3=ADcio=202=20Javascript=20resolvido?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aulas-javascript/exercicios/aula1/index.html | 4 +-- .../exercicios/aula2/exercicio_javascript2.js | 29 +++++++++++++++++ aulas-javascript/exercicios/aula2/index.html | 31 +++++++++++++++++++ aulas-javascript/exercicios/aula2/style.css | 19 ++++++++++++ 4 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 aulas-javascript/exercicios/aula2/exercicio_javascript2.js create mode 100644 aulas-javascript/exercicios/aula2/style.css diff --git a/aulas-javascript/exercicios/aula1/index.html b/aulas-javascript/exercicios/aula1/index.html index c2a20de..248a5de 100644 --- a/aulas-javascript/exercicios/aula1/index.html +++ b/aulas-javascript/exercicios/aula1/index.html @@ -2,8 +2,8 @@ - - + + Exemplo de JavaScript Externo diff --git a/aulas-javascript/exercicios/aula2/exercicio_javascript2.js b/aulas-javascript/exercicios/aula2/exercicio_javascript2.js new file mode 100644 index 0000000..9cbacca --- /dev/null +++ b/aulas-javascript/exercicios/aula2/exercicio_javascript2.js @@ -0,0 +1,29 @@ +function saoDiferentes(){ + let input1 = document.querySelector('#input1').value; + let input2 = document.querySelector('#input2').value; + + if (input1 !== input2){ + let div = document.createElement('div'); + div.innerText = 'Os valores são diferentes!'; + document.body.append(div); + div.style.color = 'green'; + div.style.marginTop = '30px'; + div.style.fontSize = '24px'; + } else{ + let div = document.createElement('div'); + div.innerText = 'Não são diferentes!'; + document.body.append(div); + div.style.color = 'red'; + div.style.marginTop = '30px'; + div.style.fontSize = '24px'; + } +} + +function resetar(){ + document.getElementById('input1').value = ''; + document.getElementById('input2').value = ''; + document.getElementsByTagName('div').remove(); +} + +document.getElementById('botaoChecar').onclick = saoDiferentes; +document.getElementById('botaoResetar').onclick = resetar; \ No newline at end of file diff --git a/aulas-javascript/exercicios/aula2/index.html b/aulas-javascript/exercicios/aula2/index.html index e69de29..ada500e 100644 --- a/aulas-javascript/exercicios/aula2/index.html +++ b/aulas-javascript/exercicios/aula2/index.html @@ -0,0 +1,31 @@ + + + + + + Exemplo de JavaScript Externo + + + + +
+

Formulário - Comparar Números.

+
+
+
+ +
+
+ +
+ + +
+ + \ No newline at end of file diff --git a/aulas-javascript/exercicios/aula2/style.css b/aulas-javascript/exercicios/aula2/style.css new file mode 100644 index 0000000..5cab1e7 --- /dev/null +++ b/aulas-javascript/exercicios/aula2/style.css @@ -0,0 +1,19 @@ +body { + display: flex; + flex-direction: column; + flex: 1; + align-items: center; + box-sizing: border-box; + justify-content: center; +} + +input { /*-aplica por padrão a margin em todas tags input-*/ + border:none; + background:#fafafa; + color:000; + margin: 10px; +} + +button { + border: none; +}