jQuery to move alt text to each silbling element only

As we cannot get the alt texts of CMS’ multi-image to display as text. I am trying to use some custom script to move them to another element.

I tried playing around with .append(), .insertAdjacentHTML() and .insertAfter() to move each image’s alt text to its sibling element, but it is not working as expected…

Here are the codes I am trying:

var altText = $("img").attr("alt");
$("span#here").append(altText);

The target result is:
Image 1
Caption 1
Image 2
Caption 2

:raised_hands: Greatly appreciated it if anyone could help, thanks!

Solved~
Happy to share the solution.

One image / one time:

Multiple images: