document.addEventListener("DOMContentLoaded", function() {
// Check if the div with class 'cbt-resources' exists
if (document.querySelector('.cbt-resources')) {
// Select all carousel items
var carouselItems = document.querySelectorAll('.wdcl-carousel-item a');
// Loop through each item
carouselItems.forEach(function(item) {
// Find the image inside the anchor
var img = item.querySelector('img');
// Get the alt text
var altText = img.getAttribute('alt');
// Create the h4 element
var h4 = document.createElement('h4');
h4.textContent = altText;
// Insert the h4 element after the image
item.insertBefore(h4, img.nextSibling);
});
}
});