I have to modify a Shopify website with a blog that extracts the content of blog articles using
{{ article.content }}
Lets say your article is in a div. Like
<div class="article-content">{{ article.content }}</div>
Now we can put all images under that div into an array.
$(document).ready(function(){
// To save all images in an array named img_array
var img_array = $('.article-content img').map(function() {
return $(this).attr("src");
});
// You can run a for loop to display the images in the array.
for (var i=0; i<img_array.length; i++) {
alert(img_array[i]);
}
});
Let me know if that helps.
reference : Get inside all images in array using jquery?