I’m trying to do a seemingly simple loop, but I keep running into issues.
I’m trying to loop through a specific div (targeted by an ID), and return the source of the two images inside of it. Here is my HTML:
<div id="container">
<div class="row selected" id="one"><img src="onei.png"><img src="twoi.png"></div>
<div class="row" id="two"><img src="onei1.png"><img src="twoi2.png"></div>
</div>
And here is my loop:
function loop() {
alert()
$('#container row.selected img').each(function() {
alert($(this).attr('src'))
});
}
I can’t seem to find out why this isn’t working. Shouldn’t this loop through each image in my targeted div and alert the source?
maybe something like
you forgot the
.onrow