Select all items with a height greater than the specified

How to select elements with a height greater than 200px and remember them inside var.

var something = $('.myClass').withHeightMoreThan200px(); $('.myClass').each(function(){$(this).height(random(50,500)}); something.hide(); //even if after random change of height some new elements have now height >200px I want it to affect only those remembered before. 
+4
source share
1 answer

Use filter() :

 var something = $('.myClass').filter(function(){ return $(this).height() > 200; }); 
+8
source

Source: https://habr.com/ru/post/1447278/


All Articles