Develop #3
23
js.js
23
js.js
@ -7,11 +7,11 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const textLabelInput = "Imagem";
|
||||
labelInput.innerText = textLabelInput;
|
||||
|
||||
const form = document.querySelector('.form__tourist-attractions');
|
||||
const ulList = document.querySelector('.wrapper-ul__cards');
|
||||
|
||||
const inputTitle = document.querySelector('.input-text__titulo');
|
||||
const inputDescription = document.querySelector('.input-text__descricao');
|
||||
const form = document.querySelector('.form__tourist-attractions');
|
||||
|
||||
const ulList = document.querySelector('.wrapper-ul__cards');
|
||||
|
||||
//Image Preview
|
||||
inputFile.addEventListener('change', (e) => {
|
||||
@ -71,10 +71,13 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
list.push(spot);
|
||||
|
||||
renderListItems();
|
||||
resetInputs();
|
||||
|
||||
}else {
|
||||
alert('Preencha todos os campos')
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -91,21 +94,23 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
<div class="result-card__text">
|
||||
<h2 class="result-card__title">${i.titulo}</h2>
|
||||
<p> class="result-card__description">${i.description}</p>
|
||||
<p class="result-card__description">${i.description}</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
`;
|
||||
});
|
||||
|
||||
|
||||
|
||||
ulList.innerHTML = spotStructure;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
function resetInputs () {
|
||||
inputTitle.value = '';
|
||||
inputDescription.value = '';
|
||||
|
||||
labelInput.innerText = textLabelInput;
|
||||
labelInput.style.border = "";
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user