html中div获取焦点,去掉input div等获取焦点时候的边框
经测试只有在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值是负数的对象会被忽略
最新文章
- Dojo前端开发框架与jQuery前端开发框架,对比分析总结
- .net程序员转行做手游开发经历(三)
- 20130617 hbase regionserver 老挂掉
- 1、SQL基础整理(基本查询)
- PHP中关于超链接的拼接问题
- 内网架设SVN服务器相关设置
- C++ 引用(&;)
- H TML5 之 (4) 小项目一 时钟
- 开始了大概三四天的Rails学习之路
- Html事件冒泡
- sql语句中生成0-10随机数
- JAVAEE——BOS物流项目04:学习计划、datagrid、分页查询、批量删除、修改功能
- WordPress更新时提示无法连接到FTP服务器的解决方案
- Windows下的搜索神器 &mdash;&mdash; everything
- MyEclipse如何修改XML文件默认行宽
- 【Python】【unittest】unittest测试框架中setup,teardown与setupclass,teardownclass的区别
- PSP个人软件开发系统面向对象需求分析与设计文档
- CentOS7的firewall和安装iptables
- Go语言反射之类型反射
- PHP使用Redis消息队列
热门文章
- Microsoft SQL Server 2008 R2
- 详解Python中的生成器表达式(generator expression)
- IOS高级面试题
- Zabbix触发器函数(取前后差值)
- c++ vector容器的使用,序列倒叙reverse(),容器底部插入一个数值push_back()
- windows lua 多线程 线程同步
- oci学习
- ReferenceError: Promise is not define
- centos下nginx启动脚本和chkconfig管理
- CentOS系统时间与网络同步