Hello Javascript Experts.
What I want is to be able to have a div show up on a page when a user clicks a button (display=block, this part is no problem), and then when the user clicks anywhere outside the parent div for the div and all child content to go away (onblur).
So, I have the following code format:
<div onBlur="this.style.display
='none';" id="parentDiv" class="parentDiv">
Stuff in Parent
<div id="Child1" class="Child1">Stuff in Child 1</div>
<div id="Child2" class="Child2">Stuff in Child 2</div>
</div>
The problem with this is that when the children get focus, onBlur fires for the parent and the div disappears. I would like to have the parent div stay visible (display=block) as long as the user is doing anything (clicking) in the parent or any of its children. Clicking a child should not cause the parent to disappear. This is my current problem.
Thank you in advance for your help.
Regards,
Phil / peh803
Start Free Trial