onblur event not working with google chrome

Deadly 提交于 2019-11-30 10:00:34

I realize this was over a year ago, but it showed up for me in Google while trying to solve this same issue.

It seems Chrome does not consider some elements, like body and anchors, to be "focusable". According to the following page, you can make any element focusable (thereby activating the blur event) by setting the tabindex attribute: http://www.quirksmode.org/dom/events/blurfocus.html

Like so:

<a href="#" tabindex="0" onblur="alert('blur')"> blur me </a>
zubair ali

Chrome accepts OnBlur event. what i have experience is... on check or uncheck of checkbox, chrome do not focus on it.

Add attribute

onclick="this.focus()" onblur="yourMethod()"/>

you will see it work fine then.

Just ran into this issue...

onBlur (with a capital "B") doesn't work, but onblur (lowercase "b") does. Go figure! ;-/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!