博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[AngularJS] Accessible Button Events
阅读量:7298 次
发布时间:2019-06-30

本文共 658 字,大约阅读时间需要 2 分钟。

Often buttons need to be handled by JavaScript, and if done improperly it can lead to accessibility issues. In this lesson you will improve a major news organization's global header with some basic HTML and JavaScript.

 

Normal you should use native 'button' to make a button instead of use other html element to make a button, then you can access the button thought the keyboard.

If you use a 'div', then what you should do to make it accessible to the user by keyborad, you should add 'role', 'tabindex' & 'aria-label' to it:

 

If you use AngularJS,and you want press 'Enter' to get the handle event, you should add 'ng-keydown' for it:

 

转载地址:http://ytfnm.baihongyu.com/

你可能感兴趣的文章
JVM的垃圾回收与内存分配
查看>>
【涛声依旧】华为的“大服务”
查看>>
我的友情链接
查看>>
我用 Python 爬取微信好友,最后发现一个大秘密
查看>>
RPM是RedHat Package Manager(RedHat软件包管理工具)类似Windows里面的“添加/删除程序”...
查看>>
数据库9:联结表 高级联结 组合查询 全文本搜索
查看>>
sql Escape用法
查看>>
[20181015]为什么是3秒.txt
查看>>
[20181220]使用提示OR_EXPAND优化.txt
查看>>
让您的电脑在任意目录可以支持图片的粘贴,试试看呗(第二篇)~
查看>>
[Java开发之路]Java字符串
查看>>
thinkphp框架使用心得
查看>>
List------Linked 链表
查看>>
MVC 区域内默认控制器不能访问(Multiple types were found that match the controller named ‘Index')...
查看>>
C#线程间通信
查看>>
tp5页面跳转,空控制器空方法
查看>>
十六进制转byte变负数
查看>>
PHP数组操作汇总
查看>>
一本比较简单易懂的中文python入门教程
查看>>
如何使用图形界面Webmin管理linux服务器
查看>>