我有一些html代码,想要改变
内联样式
显示:块
到
显示:无
哪个班级 ln-b 到 ln-z
<div class="filter-div ln-b" style="display: block;"></div>
<div class="filter-div ln-c" style="display: block;"></div>
<div class="filter-div ln-d" style="display: block;"></div>
<div class="filter-div ln-e" style="display: block;"></div>
<div class="filter-div ln-f" style="display: block;"></div>
<div class="filter-div ln-g" style="display: block;"></div>
<div class="filter-div ln-h" style="display: block;"></div>
<div class="filter-div ln-i" style="display: block;"></div>
<div class="filter-div ln-j" style="display: block;"></div>
<div class="filter-div ln-k" style="display: block;"></div>
<div class="filter-div ln-l" style="display: block;"></div>
<div class="filter-div ln-m" style="display: block;"></div>
<div class="filter-div ln-n" style="display: block;"></div>
<div class="filter-div ln-o" style="display: block;"></div>
<div class="filter-div ln-p" style="display: block;"></div>
<div class="filter-div ln-q" style="display: block;"></div>
<div class="filter-div ln-r" style="display: block;"></div>
<div class="filter-div ln-s" style="display: block;"></div>
<div class="filter-div ln-t" style="display: block;"></div>
<div class="filter-div ln-u" style="display: block;"></div>
<div class="filter-div ln-v" style="display: block;"></div>
<div class="filter-div ln-w" style="display: block;"></div>
<div class="filter-div ln-x" style="display: block;"></div>
<div class="filter-div ln-y" style="display: block;"></div>
<div class="filter-div ln-z" style="display: block;"></div>
有任何想法或建议吗?感谢。
答案 0 :(得分:3)
我建议(假设它们按顺序出现并且是兄弟姐妹),还有一个.filter-div.ln-a
元素你不想隐藏:
$('.filter-div.ln-b').nextUntil($('.ln-z').next()).addBack().css('display','none');
参考文献:
答案 1 :(得分:0)
$('div[class*="ln-"]').hide();
答案 2 :(得分:0)
$(".filter-div").css("display","none");
或
$('.filter-div').each(function() {
$(this).css("display","none");
}
答案 3 :(得分:0)
答案 4 :(得分:0)
试试这个:
$('div[class*="ln-"]').css('display','none');