data.forEach((movie) => {
const movieEl = document.createElement("span");
movieEl.classList.add("staff");
movieEl.innerHTML = `<a class="actors" href="/xfsearch/actors/${movie.nameRu}">
<img src="${movie.posterUrl}" alt="${movie.nameRu}"/>
<div class="professionText">${movie.professionText.replace(/ы$/, "")}</div>
<div class="nameru">${movie.nameRu}</div>
</span></a>`;
moviesEl.appendChild(movieEl);
});
<a class="filter-link" href="#" onclick="$('.filter-block-cat').toggle();return false;">Кнопка</a>
$(document).on('click', function(e) {
if (!$(e.target).closest(".filter").length) {
$('.filter-block').hide();
}
e.stopPropagation();
});
$(".filter-link").click(function() {
$('.filter-block').toggle();
});
movieEl.innerHTML = `<a class="thumbnail" href="#"><span><div class="class">${movie.nameRu}</div><div class="professionText">${movie.professionText.replace(/ы$/, "")}</div><img src="${movie.posterUrl}" alt="${movie.nameRu}"/></span>, ${movie.nameRu.slice(-3,-1)}</a>`;