I have the following timer which periodically updates my page:
var refreshId = setInterval(function() {
$(".content").each(function(i) {
// Do stuff
$(this).each(function(i) {
// issue here
});
});
}, 10000);
Within the nested foreach loop, I would like to extract only images, so essentially, I would want to match this > .icons > .img, as my images are inside of a div of class “icons”.
The markup for the section would look like the following:
<div class="content">
<div></div>
<div class="icons">
<img id="dynamicImage12345" src="#">
</div>
</div>
How can I accomplish this?
You need this line there:
It is assumed that you are using
imgclass for your images as can be seen from your code. If you are not using a class, you can try this instead:So it becomes: