Check the test page here http://rickchristie.com/testfocus.html
Correct me if I'm wrong:
onfocus
happens when the element gains focus.onblur
happens when the element loses the focus.
In Firefox 3.6.12 (tested on mac and windows), using onblur
without onfocus
works fine. However when an input element has both onfocus
and onblur
element, it gets weird:
- When you click at the input,
onblur
is fired instead ofonfocus
. - Right after
onblur
,onfocus
fires immediately. - You can't type anything in the textbox.
Other browsers (Safari, Opera) works as expected. Is this a bug? Is it just me or is everybody using Firefox experiencing this?
Update
This behavior seems to happen only when onblur
and onfocus
contains alert
- not when I use something like window.log
.