如何显示隐藏父级的div?
<div class='hidden' style="display:none">
<div class='visible' style="display:block">
Div Content
</div>
</div>
答案 0 :(得分:0)
<div class='hidden'>
<div class='visible'>
Div Content
</div>
</div>
<强> CSS 强>
.hidden>div
{
visibility: visible;
}
.hidden
{
visibility: hidden;
}
<强> DEMO 强>
或强>
您可以clone
hidden div
,然后append
到另一个div。像这样:
<div class='hidden' style="display:none">
<div class='visible'>
Div Content
</div>
</div>
<div id="dv"> </div>
$(document).ready(function () {
var element = jQuery('.visible').clone();
element.appendTo('#dv');
});
<强> DEMO 强>