经测试只有在IE chrome才会在获取焦点时有边框

使用CSS

div{
outline:none;
}

DIV焦点事件详解 --【focus和tabIndex】​

摘自:http://my.oschina.net/jgy/blog/131970

添加 tabindex='-1' 属性;

默认:获取不到焦点事件(blur)

<div class="wl-product" id="wl-product"></div>

可以获取焦点事件(blur)

<div class="wl-product" id="wl-product" tabindex='-1'></div>

首先看看w3c关于onfocus的部分
The onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation. 
This attribute may be used with the following elements: A, AREA, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON. 
当元素通过指定(点击)或tab导航(Tabbing navigation)获得焦点,onfocus事件就会触发。
该属性会使用在以下元素(就是说默认可以获取焦点的元素):A, AREA, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.

div, frameSet, span, table, td.只有设置tableindex才能获取焦点,但

IE默认能获取焦点但不能tab导航

不同tabIndex值在tab order(Tabbing navigation)中的情况:
Objects with a positive tabIndex are selected in increasing iIndex order and in source order to resolve duplicates.
Objects with an tabIndex of zero are selected in source order. 
Objects with a negative tabIndex are omitted from the tabbing order.
tabIndex值是正数的对象根据递增的值顺序和代码中的位置顺序来被选择
tabIndex值是0的对象根据在代码中的位置顺序被选择
tabIndex值是负数的对象会被忽略

最新文章

  1. Dojo前端开发框架与jQuery前端开发框架,对比分析总结
  2. .net程序员转行做手游开发经历(三)
  3. 20130617 hbase regionserver 老挂掉
  4. 1、SQL基础整理(基本查询)
  5. PHP中关于超链接的拼接问题
  6. 内网架设SVN服务器相关设置
  7. C++ 引用(&amp;)
  8. H TML5 之 (4) 小项目一 时钟
  9. 开始了大概三四天的Rails学习之路
  10. Html事件冒泡
  11. sql语句中生成0-10随机数
  12. JAVAEE——BOS物流项目04:学习计划、datagrid、分页查询、批量删除、修改功能
  13. WordPress更新时提示无法连接到FTP服务器的解决方案
  14. Windows下的搜索神器 &mdash;&mdash; everything
  15. MyEclipse如何修改XML文件默认行宽
  16. 【Python】【unittest】unittest测试框架中setup,teardown与setupclass,teardownclass的区别
  17. PSP个人软件开发系统面向对象需求分析与设计文档
  18. CentOS7的firewall和安装iptables
  19. Go语言反射之类型反射
  20. PHP使用Redis消息队列

热门文章

  1. Microsoft SQL Server 2008 R2
  2. 详解Python中的生成器表达式(generator expression)
  3. IOS高级面试题
  4. Zabbix触发器函数(取前后差值)
  5. c++ vector容器的使用,序列倒叙reverse(),容器底部插入一个数值push_back()
  6. windows lua 多线程 线程同步
  7. oci学习
  8. ReferenceError: Promise is not define
  9. centos下nginx启动脚本和chkconfig管理
  10. CentOS系统时间与网络同步