changements CSS pour titre et menu/dans films affichage des titres des films/dans html ajout des class et section pour lien css et js

This commit is contained in:
Blandine Bajard 2021-10-19 13:04:58 +02:00
parent 179550874e
commit 8d7069003c
4 changed files with 54 additions and 14 deletions

View file

@ -1,5 +1,23 @@
const EPISODE4 = document.getElementById('Ep4');
const DONNEES = document.getElementById('donnees');
const VAISSEAUX = document.getElementById('vaisseaux');
const PLANETES = document.getElementById('planetes');
const FILMS = document.getElementById('reponses-films');
const DEPLIE = document.getElementById ('deploiement-films');
console.log(FILMS);
const API_URL = "https://swapi.dev/api/films/";
fetch(API_URL)
.then((response) => {
console.log(response);
return response.json();
})
.then(afficherFilms => {
console.log(afficherFilms);
for(let index = 0; index <6; index++){
console.log(afficherFilms.results[index]);
const EPISODES = afficherFilms.results[index];
console.log(EPISODES);
FILMS.innerHTML +=`
<p class= "titre">${EPISODES.title}</p>
`
}
})