<h3>Case of one image, ie. run one time only</h3>

<img src="https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE4Y5jq?ver=ac72&q=90&m=6&h=201&w=358&b=%23FFFFFFFF&l=f&o=t&aim=true" alt="Example Image Caption 1" class="demo-img">

<span id="here"></span>
.demo-img {
  width: 280px;
}
span#here {
  display: block;
}
var altText = $("img").attr("alt");
$("span#here").append(altText);
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js