I have this html and want to select only the div with class 'image-container landscape'.
<div class="image-container landscape">
...
</div>
...
<div class="image-container portrait">
...
</div>
Using $(element).find('.image-container')
selects either one of the div, that comes first. But I only want the one with 'landscape'. I tried using $(element).find('.image-container landscape')
but it doesn't work, maybe because it assumes landscape
is a tag. How do I do this?
Yes, it would assume landscape was a tag. You want either:
[class="image-container landscape"]
or
.image-container.landscape
This is just CSS3 for the record, you can probably read the full specs in less than an hour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With