$('div').filter('#idOfDivToShow').show(); $('div').not('#idOfDivToShow').hide();
$('div') will find all divs on your web page. .filter will search the results matching $('div') and match elements with id = idOfDivToShow. .not will search the results matching $('div') and match elements that don't have id = idOfDivToShow.
Finally, if you want to search only in a specific element, say #infocontent, then you can write:
$('#infocontent').filter('div').filter('#idOfDivToShow').show(); $('#infocontent').filter('div').not('#idOfDivToShow').hide();
Daniel Allen Langdon
source share