<body>
<div>
<img
alt="Day Path Detail"
src="https://farm9.staticflickr.com/8676/16647504962_8e84ed1e08_q_d.jpg"
srcset="https://farm9.staticflickr.com/8676/16647504962_8e84ed1e08_m_d.jpg 240w, https://farm9.staticflickr.com/8676/16647504962_8e84ed1e08_z_d.jpg 640w, https://farm9.staticflickr.com/8676/16647504962_6592350fbb_k_d.jpg 2048w"
sizes="100vw"
/>
<h2><span></span></h2>
</div>
</body>
(function($) {
"use strict";
$(window.document).ready(function()
{
var img = $('body>div>img');
img.load(function()
{
var currentSrc = (img.prop('currentSrc') || img.attr('src'));
var span = $('body>div>h2>span');
var length = currentSrc.length;
span.text(currentSrc.substr(length - 8));
});
});
}(jQuery));