blur vs focusout -- any real differences?

JavascriptJquery

Javascript Problem Overview


Is there any difference between JS events blur vs focusout?

I have two textboxes: pwd and confirm pwd. I want to check password match when user tabs out of the confirm pwd textbox, for example. In this case which event should I use or does it matter?

Javascript Solutions


Solution 1 - Javascript

The documentation for focusout says (emphasis mine):

> The focusout event is sent to an element when it, or any element > inside of it, loses focus. This is distinct from the blur event in > that it supports detecting the loss of focus on descendant elements (in > other words, it supports event bubbling).

The same distinction exists between the focusin and focus events.

Solution 2 - Javascript

As stated in the JQuery documentation

>The focusout event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the blur event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLagunaView Question on Stackoverflow
Solution 1 - JavascriptFrédéric HamidiView Answer on Stackoverflow
Solution 2 - JavascriptnulltokenView Answer on Stackoverflow