How can I select in jQuery all the div
s that have background-image: url(somepath/somename.png)
in their style?
Try adding a custom selector:
$(document).ready(function() {
$.extend($.expr[':'], {
hasMyImage: function(el) {
return ($(el).css('background-image') == "Url('somepath/somename.png')");
}
});
});
Then to select:
$("div:hasMyImage");
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