Reputation: 3999
My code looks like this:
<div id="div1">
<span id="span1"></span>
<span id="span2"></span>
<span id="span3"></span>
</div>
I used these jquery commands:
$('#span1').hide()
$('#span2').hide()
Now I want to unhide all the elements within div1.
How can I do that? Thanks for the help!
Upvotes: 2
Views: 9797
Reputation: 383
$('#div1 span').show();
or whole document
$('span').show();
Upvotes: 0
Reputation: 3343
You could do this:
$('div#div1 span').show();
Which would show each span inside the div with id='div1'.
Or, if the div contains things which aren't spans, you can use:
$('div#div1').children().show();
Upvotes: 8