Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有更好的版本:
$(a[href$=".jpg"],a[href$=".gif"],a[href$=".png"],a[href$=".jpeg])
我感兴趣有两个原因:
你可以使用这样的东西:
$.expr[':'].img = function(obj) { return (/\.(jpg|gif|png|jpeg)$/i).test(obj.href); }
然后像这样调用图像:
$("a:img")