选择所有宽度为某个特定值的同级元素

3
如何选择所有宽度为定义值的兄弟元素?
IE中:
$(this).siblings(all with width of 400px).dosomething();

thank you

d.

1个回答

4

.filter 是你需要的:

$(this).siblings().filter(function() {
    return $(this).width() === 400;
}).dosomething();

JSFiddle Example


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接