Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolução dos exercícios propostos #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercicio2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Crie um campo label e um campo input na página HTML, e preencha o campo com o n
Depois disso, escreva **No DevTools** o código necessário para que seja possível imprimir o valor do input escrito no console.
Cole o comando aqui:
```jsx
cole o código JS nesta área.
console.log(fruta4.innerHTML)
```
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<li id="fruta-3"></li>
<li id="fruta-4"></li>
</ul>
<!-- Exercício 02 incluir Label e imput -->
<label for="fruta">Nova Fruta:</label>
<input id="fruta" type="text"/>
<button onclick="adicionaFruta()">Adicionar à lista!</button>
</main>
</body>

Expand Down
25 changes: 24 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
const frutas = ["laranja", "limão", "uva"];
const frutas = ["laranja", "limão", "uva"];

//Exercício 01

const fruta1 = document.getElementById("fruta-1")
fruta1.innerHTML = frutas[0]

const fruta2 = document.getElementById("fruta-2")
fruta2.innerHTML = frutas[1]

const fruta3 = document.getElementById("fruta-3")
fruta3.innerHTML = frutas[2]

//Exercício 02 no HTML.

//Exercício 03
const input = document.getElementById('fruta')
const fruta4 = document.getElementById('fruta-4')

function adicionaFruta() {
fruta4.innerHTML = input.value
}

//Conclusão do 03 com auxilio da profa. Tay