I made a function, but I hope I can do it by jquery selectors. $(function() { $('div').each(function() { var $bk = $(this).css('background-image'); if ($bk.match('png')) { console.log('yes'); } else { console.log('no'); } }); });
On 2月25日, 下午12時53分, "David .Wu" <chan1...@gmail.com> wrote: > I have hundred or css class need that, I am afraid that it's better to > search which has the property. > > On 2月25日, 下午12時18分, Steven Yang <kenshin...@gmail.com> wrote: > > > according to your case > > use$(".box") > > or > > $("div .box") > > since all elements with class "box" will have background image