I am trying to to get id of the image of the carousel that will be the active item. That is I am trying to get of the image id of the slide event. Currently, I have:
function ModalImageCaption () {
var activeImage =
$('.carousel').on('slide.bs.carousel', function(event){
var imageId = $(event.relatedTarget).find('.carousel-inner');
console.log (imageId);
});
}
The console log implies that there are children nodes one of them being the image child so I update imageId variable to
var imageId=$(event.relatedTarget).find('.carousel-inner').children('img').attr('id');
but it always comes back as undefined is there something I am missing?