From 04d57a2ed23925b85114fad56ed43a774234261e Mon Sep 17 00:00:00 2001 From: Samdrade Date: Sat, 17 Apr 2021 17:39:24 -0300 Subject: [PATCH] exercicios resolvidos --- Exercicios/1/index.html | 7 +++- Exercicios/1/js/script.js | 30 +++++++++++++ Exercicios/2/index.html | 37 ++++++++-------- Exercicios/3/index.html | 49 ++++++++-------------- Exercicios/3/script/script.js | 23 ++++++---- Exercicios/Teste-Event-Listener/index.html | 21 ++++++++++ Exercicios/Teste-Event-Listener/script.js | 7 ++++ Exercicios/Teste-Exemplo/index.html | 14 +++++++ Exercicios/Teste-Exemplo/script.js | 4 ++ Exercicios/Teste-Query-Selector/index.html | 21 ++++++++++ Exercicios/Teste-Query-Selector/script.js | 7 ++++ Exercicios/Teste-Query-Selector/style.css | 3 ++ 12 files changed, 162 insertions(+), 61 deletions(-) create mode 100644 Exercicios/Teste-Event-Listener/index.html create mode 100644 Exercicios/Teste-Event-Listener/script.js create mode 100644 Exercicios/Teste-Exemplo/index.html create mode 100644 Exercicios/Teste-Exemplo/script.js create mode 100644 Exercicios/Teste-Query-Selector/index.html create mode 100644 Exercicios/Teste-Query-Selector/script.js create mode 100644 Exercicios/Teste-Query-Selector/style.css diff --git a/Exercicios/1/index.html b/Exercicios/1/index.html index c048397..f4b5d9d 100644 --- a/Exercicios/1/index.html +++ b/Exercicios/1/index.html @@ -7,6 +7,11 @@ Document - +
+ + +
+
+ < src="./js/.js"> \ No newline at end of file diff --git a/Exercicios/1/js/script.js b/Exercicios/1/js/script.js index e69de29..bf5740c 100644 --- a/Exercicios/1/js/script.js +++ b/Exercicios/1/js/script.js @@ -0,0 +1,30 @@ +// document.querySelector('#botaoDeEnviar').addEventListener('click', function armazenarDados(event) { + event.preventDefault(); + + let pegaNome = document.getElementById('nomeDaPessoa'); + let exibeResposta = document.getElementById('resposta'); + + pegaNome.value === '' ? exibeResposta.innerText= 'Por favor, digite o seu nome' : exibeResposta.innerHTML = (`${pegaNome.value}, dados salvos com sucesso!`) + + /* if (pegaNome.value === '') { + exibeResposta.innerText= 'Por favor, digite o seu nome'; + } else { + exibeResposta.innerHTML = (`${pegaNome.value}, dados salvos com sucesso!`); + } */ + +}) + +//function exibirDados(event) { + event.preventDefault(); + let pegaNome = document.getElementById('nomeDaPessoa'); + let exibeResposta = document.getElementById('resposta'); + + if (pegaNome.value === '') { + exibeResposta.innerText= 'Por favor, digite o seu nome'; + } else { + exibeResposta.innerHTML = (`${pegaNome.value}, dados salvos com sucesso!`); + } + +} + + diff --git a/Exercicios/2/index.html b/Exercicios/2/index.html index 5c3fad8..7492854 100644 --- a/Exercicios/2/index.html +++ b/Exercicios/2/index.html @@ -1,21 +1,18 @@ + - - - DOM - - - - -

Venda de apartamentos

-
Apartamento de dois dormitórios, clique e veja o preço:
- -
-
-
-
-
Apartamento de três dormitórios, clique e veja o preço:
- -
- - - \ No newline at end of file + + + + + + Document + + +
+ + +
+
+ < src="./js/2.js"> + + diff --git a/Exercicios/3/index.html b/Exercicios/3/index.html index 458873b..fce56a6 100644 --- a/Exercicios/3/index.html +++ b/Exercicios/3/index.html @@ -1,36 +1,21 @@ - - - - - - - Ex 1 - News - - + + + + DOM + - - -
-
-

Se inscreva para receber mais informações

+ + +

Venda de apartamentos

+ +
Apartamento de dois dormitórios, clique e veja o preço:
+ +
-

- -

+
Apartamento de três dormitórios, clique e veja o preço:
+ +
-
-
- - -
-
- -
-
-
-
- - + < src="js/.js"> + \ No newline at end of file diff --git a/Exercicios/3/script/script.js b/Exercicios/3/script/script.js index 5bc108a..a470962 100644 --- a/Exercicios/3/script/script.js +++ b/Exercicios/3/script/script.js @@ -1,11 +1,18 @@ -/*Sequência lógica +function mostraPrecoAptoDoisDorm() { -1 - armazenar valores e-mail e botão + //evento de exibição do valor do imóvel + let getBotaoApDoisDorm = document.querySelector('#btnAptoDoisDorm'); + + getBotaoApDoisDorm.addEventListener('click', function mostraValor () { + + document.getElementById('precoAptoDoisDorm').innerText="Preço do imóvel: R$ 500.000,00"; -*/ + }) -botao.addEventListener("click", function(){ - - //evento para a exibição do texto na tela principal - -}) + }; + + function mostraPrecoAptoTresDorm() { + document.getElementById('precoAptoTresDorm').innerHTML = " Preço do imóvel: R$ 600.000,00"; + }; + + mostraPrecoAptoDoisDorm(); \ No newline at end of file diff --git a/Exercicios/Teste-Event-Listener/index.html b/Exercicios/Teste-Event-Listener/index.html new file mode 100644 index 0000000..5ac38e3 --- /dev/null +++ b/Exercicios/Teste-Event-Listener/index.html @@ -0,0 +1,21 @@ + + + + + + + Document + + + +

Olá a todos!

+ +

Meu nome é Vivian.

+ + Clique para mudar o background dessa página. + + + + + + \ No newline at end of file diff --git a/Exercicios/Teste-Event-Listener/script.js b/Exercicios/Teste-Event-Listener/script.js new file mode 100644 index 0000000..d18f048 --- /dev/null +++ b/Exercicios/Teste-Event-Listener/script.js @@ -0,0 +1,7 @@ +document.getElementById('acoesBotao').addEventListener('click', function acionarBotao() { + const mudaCorTitulo = document.querySelector('.meu-titulo').style.color = "blue"; + + const mudaTextoParagrafo = document.querySelector('#meuNome').innerHTML += " E eu tenho 32 anos." + + const mudaEstiloSpan = document.querySelector('span').style.textDecoration = "underline"; +}); \ No newline at end of file diff --git a/Exercicios/Teste-Exemplo/index.html b/Exercicios/Teste-Exemplo/index.html new file mode 100644 index 0000000..2bb1e54 --- /dev/null +++ b/Exercicios/Teste-Exemplo/index.html @@ -0,0 +1,14 @@ + + + + + + + Minha primeira página. + + +

Clique nesse botão para mudar o texto desse parágrafo!

+ + + + \ No newline at end of file diff --git a/Exercicios/Teste-Exemplo/script.js b/Exercicios/Teste-Exemplo/script.js new file mode 100644 index 0000000..c1cf74e --- /dev/null +++ b/Exercicios/Teste-Exemplo/script.js @@ -0,0 +1,4 @@ +function alterarTexto() { + const textoAAlterar = document.getElementById("mudanca-texto").innerHTML = " Hello Word"; + return textoAAlterar; +} diff --git a/Exercicios/Teste-Query-Selector/index.html b/Exercicios/Teste-Query-Selector/index.html new file mode 100644 index 0000000..80e5adf --- /dev/null +++ b/Exercicios/Teste-Query-Selector/index.html @@ -0,0 +1,21 @@ + + + + + + + Document + + + +

Olá a todos!

+ +

Meu nome é Vivian.

+ + Clique para mudar o background dessa página. + + + + + + \ No newline at end of file diff --git a/Exercicios/Teste-Query-Selector/script.js b/Exercicios/Teste-Query-Selector/script.js new file mode 100644 index 0000000..eb9f2ef --- /dev/null +++ b/Exercicios/Teste-Query-Selector/script.js @@ -0,0 +1,7 @@ +function mudarCor() { + const mudaCorTitulo = document.querySelector('.meu-titulo').style.color = "blue"; + + const mudaParagrafo = document.querySelector('#meuNome').innerHTML += " E eu tenho 32 anos." + + const mudaSpan = document.querySelector('span').style.textDecoration = "underline"; +} \ No newline at end of file diff --git a/Exercicios/Teste-Query-Selector/style.css b/Exercicios/Teste-Query-Selector/style.css new file mode 100644 index 0000000..71d7c03 --- /dev/null +++ b/Exercicios/Teste-Query-Selector/style.css @@ -0,0 +1,3 @@ +* { + background-color: lightcoral; +} \ No newline at end of file