loss of focus and click on non-target

loss of focus and click on non-target

Hi, i am having trouble finding a way to solve this little problem i have. Therefore i turned to this forum in the hope any one here could me out!

Let me point out my problem:

I have an anchor, and when it is clicked, there will be a new dropdown box visible, BUT when you mouse out on either the dropdown box OR the anchor,
and you CLICK, the dropdownbox must dissappear.

I have had no luck with the blur(), if(focus)else{} or any combination between.
The same goes for the mouseout function, which ( at a certain level, works.. ) However, i can not bind it to a way that it should only remove the box when there was a clicking action.

I hope i make any sense, if not, please do let me know, and i will try to make a better example!

With kind regards,
Merijn