Reputation: 127
Lets see this simple fiddle:
<div id="a" style="display: none;">1
<div style="display: none;">2
<div style="display: none;">3
<div style="display: none;">4</div>
</div>
</div>
</div>
$(document).ready(function()
{
$('#a').show('fast');
});
I want to see all 1 2 3 4 but instead I only see 1. How to tell to jQuery to show all nested items?
Upvotes: 0
Views: 87
Reputation: 20364
In order to show all 4, just remove display: none;
from the nested div
s
<div id="a" style="display: none;">1
<div>2
<div>3
<div>4</div>
</div>
</div>
</div>
$(document).ready(function()
{
$('#a').show('fast');
});
Upvotes: 1
Reputation: 2796
Try:
$(document).ready(function()
{
$('#a, #a div').show('fast');
});
Upvotes: 1
Reputation: 58601
You need to select all elements, not just the parent...
$('#a, #a div').show('fast');
Upvotes: 1