Solution 要做什麼
對照完整答案、責任邊界與原因。
本主題檔案:files/index.html
定位:先檢查兩個按鈕各自的 attribute,不以灰色外觀判斷。
Solution · code-edit
對照完整答案、責任邊界與原因。
對照完整答案、責任邊界與原因。
本主題檔案:files/index.html
定位:先檢查兩個按鈕各自的 attribute,不以灰色外觀判斷。
頁面不會替你修改檔案;請在實作檔完成後重新整理確認。
原生 disabled 與 aria-disabled 按鈕並列;aria 按鈕事件守門計數從0開始。
現有 runtime 聚焦 aria-disabled button 成功;required facts disabledFocused=false、ariaDisabledFocused=true、blockedClicks=1。
button.setAttribute('aria-disabled','true');button.addEventListener('click',e=>{if(button.ariaDisabled==='true')e.preventDefault()})只在本階段資料夾內操作,避免改到其他章節。
index.htmlstyle.cssmain.js證據:activeId=aria-disabled-button、focused=true;required facts disabledFocused=false、ariaDisabledFocused=true、blockedClicks=1
回到主題說明