I want to add hyperlink (a href tag ) to img.src=image_url +Trending_movie.poster_path
function Trending_movies_section(trending_movies) {
const section = document.createElement('section');
section.classList = 'section';
trending_movies.map((Tending_movie) => {
if (Tending_movie.poster_path) {
const img = document.createElement('img');
img.setAttribute('class', 'trending_images');
a.href = "https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_img_src2";
img.src = image_url + Tending_movie.poster_path;
section.appendChild(img);
}
})
return section
}
imgtag with theatag inhtmland where yourais declared?