I’m trying to reference all img in an element. See my example below.
<div class="entry">
<div class="entry-content">
<p><img src="something.jpg" /></p>
</div>
</div>
With the above, I use $(".entry > .entry-content > p > img") but it doesn’t seem to work. What is the correct way use the selector for class names that have dashes on them?
Demo http://jsfiddle.net/yrTg3/
Your selectors are correct. See your version working here: http://jsfiddle.net/yrTg3/1/
Not sure why you are doing that but this will work:
Or
Try passing attr ‘class’ in images and use
.eachfunction to iterate through.