What is the difference between focusin / focusout versus focus / blur in jQuery?
source link: https://www.codesd.com/item/what-is-the-difference-between-focusin-focusout-versus-focus-blur-in-jquery.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
What is the difference between focusin / focusout versus focus / blur in jQuery?
This question already has an answer here:
- Difference between focusin/focusout and focus/blur, with example 2 answers
I was handling some events using the following code with jQuery 1.7.2:
$().on('focus blur', function(event) {
console.log(event.type);
});
And I have noticed that event.type
for both events, prints out: focusin
and focusout
.
What is difference between focusin/focusout
vs focus/blur
?
Short answer: focusin
bubbles, focus
does not.
focusout
bubbles, blur
does not.
Read the docs:
The focusin event is sent to an element when it, or any element inside of it, gains focus. This is distinct from the focus event in that it supports detecting the focus event on parent elements (in other words, it supports event bubbling).
Related Articles
Difference between focusin / focusout and focus / blur, for example
What is the difference between async: false and async: true in jquery ajax?
What is the difference between take-off and focus to see the controllers?
What is the difference between casting and down-casting versus the class variable
What is the difference between the primary key in the table definitions versus the single clustered index
What is the difference between adding an element to a JFrame versus a container?
What is the difference between WPF and Silverlight?
What are the differences between private jre and public jre?
C ++: what is the difference between ostream and ostringstream?
What is the difference between ^ and \ A, $ and \ Z in regex?
What is the difference between & ldquo; text & rdquo; and New String (& ldquo; text & rdquo;)?
What is the difference between several parameter lists and several parameters per list in Scala?
In Ruby on Rails, what is the difference between installing something like gem or plugin?
What is the difference between the svg attribute x and dx?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK