feat(TouristAttractions): Desenvolve código Js para resetar inputs

This commit is contained in:
William Simão Cavalcante 2022-11-18 14:54:07 -03:00
parent ded8a7d875
commit 19f35863d9

21
js.js
View File

@ -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 = "";
};
});