Eri*_*ric 14
使用filter()功能:
$('table').filter(function() {
return $(this).width() > 700;
});
Run Code Online (Sandbox Code Playgroud)
是这样的:
$('table[width="700"]')
Run Code Online (Sandbox Code Playgroud)
或者你可以得到所有具有宽度的表,如下所示:
$('table[width]')
Run Code Online (Sandbox Code Playgroud)
小智 5
或者创建自己的选择器
$.expr[':'].atLeast700px = function(obj){
return $(obj).width() >= 700;
};
$('table:atLeast700px'); // returns all your tables 700px or wider
Run Code Online (Sandbox Code Playgroud)