get mouse click if inside a div or not
Use this Code :
OR
- <code>
- $("body > div").click(function() {
- if ($(this).attr("id") == "in_or_out") {
- // inside
- } else {
- // not inside
- }
- });
- </code>
- <code>
- $(document).mouseup(function (e)
- {
- var container = $("YOUR CONTAINER SELECTOR");
- if (container.has(e.target).length === 0)
- {
- container.hide();
- }
- });
- </code>