cssのstyleがdisplay noneの要素に直接removeする書き方がわからなかったので、とりあえずクラス付与してそれをremoveして消してます。
sample
See the Pen jQueryで、display: none;になっている要素をremoveする by takapen (@takapen) on CodePen.
html
bbb
ccc
aaa
bbb
ccc
css
.soldout {
display: none;
}
js
$(function(){
$('.area01').find('.item').each(function(){
if ( $(this).css('display') == 'none' ) {
$(this).addClass("soldout");
$('.soldout').remove();
}
});
});
$(function(){
$('.area02').each(function(){
if ( $(this).find('.soldout')) {
$(this).find('.soldout').remove();
}
});
});