I have a page with a div element in it. i want when i clicked on outer area of that div element, then fade it out.
but i don’t know how detect area of mouse click.
how detect that mouse click point is out of div area or not??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is not very complicated – you have two options:
1. Asign onclick event to the outer area.
2. Traverse the dom and compare
event.target(event.srcElement)