Update script.js

pull/233/head
Jleo-cjy 4 months ago committed by GitHub
parent c92b0bc3a8
commit 1fc8a96d23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -20,7 +20,7 @@ function showMovies(movies) {
main.innerHTML = ''
movies.forEach((movie) => {
const { title, poster_path, vote_average, overview } = movie
const { title, poster_path, vote_average, overview, id } = movie
const movieEl = document.createElement('div')
movieEl.classList.add('movie')
@ -34,6 +34,9 @@ function showMovies(movies) {
<div class="overview">
<h3>Overview</h3>
${overview}
<p style="margin-top: 10px;">
<a href="https://www.themoviedb.org/movie/${id}" target="_blank" class="detail-btn">View Details</a>
</p>
</div>
`
main.appendChild(movieEl)
@ -62,4 +65,4 @@ form.addEventListener('submit', (e) => {
} else {
window.location.reload()
}
})
})

Loading…
Cancel
Save