开发者

Jquery selector by width

开发者 https://www.devze.com 2023-01-26 01:34 出处:网络
Would it b开发者_如何学编程e possible to select a table with a specific width ? ThanksUse the filter() function:

Would it b开发者_如何学编程e possible to select a table with a specific width ?

Thanks


Use the filter() function:

$('table').filter(function() {
    return $(this).width() > 700;
});


Yes like this:

$('table[width="700"]')

Or you can get all tables having width with whatever value like this:

$('table[width]')


Or create your own selector

$.expr[':'].atLeast700px = function(obj){
  return $(obj).width() >= 700;
};


$('table:atLeast700px');  // returns all your tables 700px or wider
0

精彩评论

暂无评论...
验证码 换一张
取 消