是否可以选择具有特定宽度的表格?
谢谢
是的,就像这样:
$('table[width="700"]')
或者您可以按以下方式获取所有宽度为任意值的表格:
$('table[width]')
或者创建您自己的选择器
$.expr[':'].atLeast700px = function(obj){
return $(obj).width() >= 700;
};
$('table:atLeast700px'); // returns all your tables 700px or wider
$.expr[':'].widthGt = function(obj, stack, meta) { return $(obj).width() >= parseInt(meta[3], 10); }; $('table:widthGt(700)');
- lonesomeday