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..248a5de 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 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; +}