add carousel #4
Loading…
Reference in New Issue
No description provided.
Delete Branch "carousel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -11,0 +20,4 @@
});
function createCarouselItems(items) {
const carousel = document.querySelector('.carousel');
nit: use an id instead of a class
@ -11,0 +24,4 @@
items.forEach(item => {
const itemDiv = document.createElement('div');
itemDiv.className = 'carousel-item';
itemDiv.innerHTML = `<a class="carousel-link" target="_blank" rel="noopener noreferrer" href="${item.link}">${item.description}</a>`;
nit: create the
<a>
element in code and change the href and innerText manually to avoid XSSyes we control both the content and the code but it's a good practice to avoid XSS