feat(TouristAttractions): Desenvolve código Js que adciona a img o titulo e a descrição

This commit is contained in:
William Simão Cavalcante 2022-11-18 14:12:35 -03:00
parent 3b14648324
commit ded8a7d875

16
js.js
View File

@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', function () {
const inputDescription = document.querySelector('.input-text__descricao');
const form = document.querySelector('.form__tourist-attractions');
const ulList = document.querySelector('wrapper-ul__cards');
const ulList = document.querySelector('.wrapper-ul__cards');
//Image Preview
inputFile.addEventListener('change', (e) => {
@ -75,23 +75,23 @@ document.addEventListener('DOMContentLoaded', function () {
}else {
alert('Preencha todos os campos')
}
})
});
const renderListItems = () => {
let spotStructure = '';
function renderListItems () {
let spotStructure = '';
list.forEach((i) => {
list.forEach(function (i) {
spotStructure += `
<li class="wrapper-cards__li">
<div class="cards">
<div class="result-card__img">
<img class="result-card__img" src="${i.image}" alt="Imagem Turismo" />
</div>
<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>
@ -100,7 +100,7 @@ document.addEventListener('DOMContentLoaded', function () {
// ulList.innerHTML = spotStructure;
ulList.innerHTML = spotStructure;