怎样治疗<a>标签不能触发onblur事件
2018-08-17 15:23
621 查看
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:
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>
相关文章推荐
- jQuery触发<a>标签的点击事件无效
- 解决<span>标签内容改变,不能触发方法的问题
- 在HTML的<img>标签使用onblur事件
- EasyUI的datagrid中<a>标签需要点两次才能触发事件的处理方法
- jquery触发<a>标签跳转事件
- jQuery触发<a>标签的点击事件后URL不跳转的解决办法
- jQuery触发<a>标签的点击事件无效
- html <a>标签触发不了onclick()事件
- webkit 内核浏览器,<img>异步加载相同URL,不触发load事件的BUG
- jquery 自动触发<a> 标签的click()方法
- 获取<a>标签点击事件的当前对象,改变文本值
- 为什么Thinkphp 中的<if><volist>等标签不能用
- 移动端 jquery 长按触发移动事件 <升级版>
- 如何在onclick事件中使用<c:out>标签传参
- jquery 自动触发<a> 标签的click()方法
- 解决内层<li>触发外层<li>设置的事件
- <a>控件和onclick事件触发的对象 this对象说明
- 给HTML<select>标签里的option添加双击事件
- 自定义屏幕中ALV 双击事件怎样触发屏幕的PAI(cl_gui_cfw=&gt;set_new_ok_code)
- CocosCreator项目学习系列<二>关于Button(添加事件)输入控制交互条件的触发_实现虚拟按钮控制_JavaScript