You can use filter:
$("ul").filter(function() {
return $(this).css("background-image") === "url(/test/test/shortcutsMenu-test.png)";
});
This will allow you to select elements ulthat have a background image defined elsewhere, not just inline. Here is a working example .
If you do not care, and the background image will always be applied inline in the attribute style, you can use the attribute selector with the attribute style.
( )
, JavaScript, indexOf ( jQuery css ):
$("ul").filter(function() {
return $(this).css("background-image").indexOf("findThisString") > -1;
});