PDA

View Full Version : mouse event help



Fourtet
Sep 4th, 2005, 12:12 PM
Hi, I have a form field which when clicked on displays a drop down div below it.

I'm trying to acheive having the div being hidden if the user clicks outside the div. I'm not sure how to do that though. At the moment I'm just using the onblur event of the form field but that means i cant have any mouse events on the drop down div, it's a little annoying.

How can I make it so when the user clicks outside of the div it hides?

pixelDepth
Sep 4th, 2005, 02:58 PM
My first thought would be to maybe put an onclick handler on the parent element of the div? Or maybe even on the body element?