googl浏览器做桌面版网站,网络引流怎么做啊?,做网站跟app的区别,html网页设计作品及其赏析默认情况下div无法获取焦点#xff0c;无法触发focus与blur事件#xff0c;推測span#xff0c;a等标签也无法触发焦点事件(input:button。及button标签能够触发) 怎样使div触发blur事件#xff1a;能够给div加上tabindex属性 在线演示#xff1a;http://sandbox.runjs.cn… 默认情况下div无法获取焦点无法触发focus与blur事件推測spana等标签也无法触发焦点事件(input:button。及button标签能够触发) 怎样使div触发blur事件能够给div加上tabindex属性 在线演示http://sandbox.runjs.cn/show/e0bvfcag 源代码 !DOCTYPE html
html langen
headmeta charsetUTF-8titleDocument/titlestyle.box{width: 200px;height: 200px;background-color: #3295F2;}/stylescript typetext/javascript srchttp://sandbox.runjs.cn/uploads/rs/294/c4c2o6mh/jquery.js/script
/head
bodyinput typetext /input typebutton value測试 classbut/buttonkkk/buttondiv classbox tabindex1/divscript$(.box).focus(function(){alert(div focus);});$(.box).blur(function(){alert(div blur);});$(.but).focus(function(){alert(but);});$(.but).blur(function(){alert(but);});$(button).focus(function(){alert(but);});$(button).blur(function(){alert(but);});/script
/body
/html 相关资料http://www.w3school.com.cn/tags/att_standard_tabindex.asp demo: http://www.w3school.com.cn/tiy/t.asp?fhtml_standard_tabindex 转载于:https://www.cnblogs.com/mengfanrong/p/5190108.html