Quick Question: How to select a div with certain width. For example we have 10 div in one page, I want to select the one that has 200px width and do something. Thanks a lot.
See Question&Answers more detail:osQuick Question: How to select a div with certain width. For example we have 10 div in one page, I want to select the one that has 200px width and do something. Thanks a lot.
See Question&Answers more detail:osWhat JCOC611 said:
var $theDivs = $('div').filter(function() { return $(this).width() === 200; });
That'd get you a jQuery object with all matching (200px) divs in it. Might not be the fastest thing in the world; it'd probably be better to more directly and explicitly identify your page elements, if you can.