有没有办法在自我禁用按钮中不读取'不可用'或'变暗'?自我禁用按钮,辅助功能
见的例子Example
var saveBtn = document.getElementById("saveBtn");
var helper = document.getElementById("helper");
var content = document.getElementById("content");
saveBtn.onclick = function(e) {
saveBtn.setAttribute("disabled", "disabled");
saveBtn.setAttribute("aria-disabled", true);
content.innerHTML = 'Lorem input a lot of stuffs';
helper.innerHTML = "Content added, please read it";
setTimeout(function(){
helper.innerHTML = "";
saveBtn.removeAttribute("disabled");
saveBtn.setAttribute("aria-disabled", false);
}, 5000);
};
- 语音只是说: '内容补充,请阅读'
- NVDA说:“内容补充,请阅读。 不可用'
我知道这是因为按钮仍然有焦点。但是,我需要找到一个解决方案,因为我无法修改我的页面的当前行为。
我使用html助手来通知转换,你可以看到https://stackoverflow.com/a/38137593/3438124。
对不起,难看的代码,这只是为了模拟我的真实行为。
谢谢你们!
有完整的例子:https://jsfiddle.net/yz29fxnv/5/ –