JavaScript has an event called onBlur that fires when a control loses focus. My question is: Why is it called that? Wouldn't all of our lives be easier if it was called OnFocusLost?
Asked
Active
Viewed 2,884 times
17
-
If you use a camera and look at something, you're focusing on it. By proxy, everything else is "blurred", is it not? Besides, my carpel tunnel doesn't like typing `OnFocusLost`. – Brad Christie Jul 07 '11 at 16:47
-
Probably because blurred means out of focus? – hammar Jul 07 '11 at 16:47
-
2The opposite of "to focus" is "to blur." – Jon Gauthier Jul 07 '11 at 16:49
-
Note that IE has a similar event called [onfocusout](http://stackoverflow.com/questions/7755052/in-web-browser-whats-the-difference-between-onblur-and-onfocusout) – Dan Dascalescu Nov 13 '12 at 07:40
-
.net WinForms calls the event .Leave and IMO that's a much better design. I've been porting a UI component and only five days into the job have I understood what this "blur" event does. The name IS cute but its not descriptive. – Quibblesome Jun 18 '19 at 13:11
1 Answers
13
I would imagine it is called this because when you lose focus on something it tends to become blurry.
No, I don't necessarily believe that my life would become easier if it was suddenly changed to onFocusLost
.

Charles Sprayberry
- 7,741
- 3
- 41
- 50