Could you please assist me with this situation...
<li id="4331">Region
<ul>
<li id="4332">Asia</li>
<li id="6621">Europe</li>
</ul>
</li>
I have a query when I click on the Region element. As a parent of ul, only Asia and Europe should be displayed while hiding the Region itself upon clicking.
I am currently using the .hide() method.
This is what I have attempted so far:
$(document).ready(function() {
$("li").live("click", function(event) {
$("li").hide();
event.cancelBubble = true;
loadChild($(this).attr("id"), event);
return false;
})
});
The current output displays as follows:
<li id="4331" style="display: none;">
Region
<ul>
<li id="4332">Asia</li>
<li id="6621">Europe</li>
</ul>
</li>
It hides everything at the moment...
However, my goal is to hide only the parent Region element. I intend to click on it, hide Region, and show Asia and Europe exclusively. I would appreciate your assistance in achieving this.
Thank you for your help.