Jquery selector by width
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
精彩评论