remove a div element when clicking anywhere else than that div element I am facing trouble in removing a div element that I have created with JavaScript. I call this function onclick  element.  function makediv(){         var div = document.createElement('DIV');         $(div).attr('id','md');         $(div).css({"left":e.pageX,"top":e.pageY });         $("body").append(div);     }   And here how I'am trying to remove when I click somewhere else than that div. before I click somewhere else the div even showed up it just deleted at the moment it created.  window.onclick = function(event)     {                    dl=$('#md');         if(event.target!=dl)             dl.remove();     }   I have also tried this one.  window.onclick = function(event)     {         if($('#md').length!=0){          dl=$('#md');         if(event.target!=dl)             dl.remove();         }     }   But this code remove div element as it is created.
How do I detect a click outside an element? I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area.  Is something like this possible with jQuery?  $("#menuscontainer").clickOutsideThisElement(function() {     // Hide the menus });
Proof that an integral domain that is a finite-dimensional $F$-vector space is in fact a field Most Common Aspect Ratio? I'm building a web site that will allow users to upload photos. For design and layout purposes, I need to know the most common aspect ratios users will upload. What is the most common aspect ratio of photos (e.g from dSLR, smart phones, etc.)? If $Y|X \sim \mathcal{N}(0,1)$ then is $Y^2|X \sim \chi^2(1)$? Suppose we have random variables $X$ and $Y$ such that $Y|X \sim \mathcal{N}(0,1)$. Can we then say that $Y^2|X \sim \chi^2(1)$? If we can, then what about when $Y|X \sim \mathcal{N}(0,\sigma^2/4)$, can we use the results of  to say that $Y^2|X \sim \frac{\sigma^2}{4}\chi^2(1)$? Essentially I want to know if the results of squaring a normal distribution can be applied to the case where a random variable is conditionally normally distributed? Groups of order $pqr$ and their normal subgroups We want to prove that a group, say $G$, of order $pqr$ where $p \gt q \gt r$ has a normal Sylow $p$-subgroup and deduce that it has a normal subgroup of order $pq$.    I know how to show $G$ has a normal Sylow $p$-subgroup or normal Sylow $q$-subgroup, but not the rest. Thanks for your advices. How do I kill the lockscreen after the Windows 10 anniversary update? Use bibliography numbers and citation from other file This question led to a new package:      I want to reference to citations from other file. Similar to what xr package does to labels, but I want to apply it for the bibliography.  If I'm able to do \cite{someone} in the main file, and it creates let say the number [4], I want to do the same \cite{someone} in a second file, and also create the same number [4]. Similar to what xr does with the labels.  By the way, I tried to add the main.bbl file from the main file. However, that adds all the references to the end of the second file. I want to avoid this.  Is there any package that accomplish this? Problem with \mkbibdateapalongextra of biblatex-apa Usage and origin of "sister" in expressions like "sister company, sister ship, sister site" etc I was doing some re-tagging and I noticed that the automatically generated revision comment says that I edited the post body where I only edited the tags. What is some good free software for doing physics calculations?  I'm mainly interested in symbolic computation (something like Mathematica, but free). The $ l^{\infty} $-norm is equal to the limit of the $ l^{p} $-norms. Please provide me with the guidance to install oracle 11gr2 on Ubuntu 14.04. How am I supposed to install El Capitan on a new SSD without recovery partition? states:  "In practice, explicit right outer joins are rarely used, since they can always be replaced with left outer joins and provide no additional functionality."  Can anyone provide a situation where they have preferred to use the RIGHT notation, and why? I can't think of a reason to ever use it. To me, it wouldn't ever make things more clear.  Edit: I'm an Oracle veteran making the New Year's Resolution to wean myself from the (+) syntax. I want to do it right Getting the starting shortcut in c# Marking plural of code words In my blog (which is about programming) I often use reserved words from different programming languages.  Like this:     When column is nullable in both tables, this query won't return a match of two NULLs for the reasons described above: no NULLs are equal.   Here, NULL is a programming language keyword.  For numerous reasons, I mark them with &lt;code&gt; tag so they are rendered with a fixed width font, not translated into the foreign languages by Google Translate, can easily be seen on the page etc.  In the example above, which would be the best way to mark the plural?   NULLs NULL s NULL's NULLs NULLS   Option 1 looks ugly on the page (the word and the plural marker are rendered in different colors and fonts)  Option 2 adds a space between the word and the plural marker  Option 3 looks nicest but is not correct  Options 4 and 5 may leave the reader under impression that NULLS is a reserved word (which is not true) and this may be confusing. Also, Google Translate would leave the word as is which would be definitely wrong in other languages.  What would be the least of 5 evils? How to get a combined ticket in IRCTC (Indian Railway) Suppose I want to go from Station A to Station C but Station C is not a stoppage of some train say train 01, so I can get a combined ticket from station A to Station B  through train 01 plus Station B to station C through a different train say 02, so my total fare will be of same ticket as from Station A to Station C.  We can get Combined ticket from the Booking Window but how's that possible on the IRCTC website? I was thinking about something the other day (that is probably stupid), and thought this would be a good place to talk about it.  If someone wanted to draw its family tree over the last 1000 years, he'd write a binary tree with a depth of about 40 (counting 25 years on average between each generations). This tree would have 240 leaves, or about 1012 ancestors on the deeper level. That is obviously much more than the total world population and a stupid figure when you think about it.  The only explanation that I can think of is that a real genealogy tree must have "linked" branches at several levels that change the actual number of ancestors. Anyway, for an average person, how many ancestors would that make? Could one assume that all or nearly all of the persons that lived in its country or world region a 1000 years ago would be part of its ancestors? fsck error on boot: /dev/sda6: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY I dual boot Ubuntu and Windows 7. I was browsing on FireFox in Ubuntu and all of a sudden I get some error message, so I rebooted.  Now when I try to boot into Ubuntu I get this message:  fsck from util-linux 2.26.2 /dev/sda6 contains a file system with errors, check forced. /dev/sda6: Inodes that were part of a corrupted orphan linked list found.  /dev/sda6: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.         (i.e., without -a or -p options) fsck exited with status code 4 The root filesystem on /dev/sda6 requires a manual fsck  Busybox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built in shell (ash) Enter 'help' for a list of built-in commands.  (initramfs) _   How can I fix this? Designer Added then removed by Visual Studio on load/unload