有沒有辦法在自我禁用按鈕中不讀取'不可用'或'變暗'?自我禁用按鈕,輔助功能
見的例子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/ –