(() => { "use strict"; const elements = Array.from(document.querySelectorAll("*")); const clickEvents = elements .map((element) => { const listeners = getEventListeners(element); const clickListeners = listeners.click || []; clickListeners.forEach((event) => (event.owner = element)); return clickListeners; }) .flat(); for (const event of clickEvents) { if (event.owner.matches("button, a[href]")) {
![アクセシブルじゃないクリックイベントを発見する](https://cdn-ak-scissors.b.st-hatena.com/image/square/6b79c1ffc76c92f935349c1320656d0c6a21e602/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--K2HpbiwG--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3A%2525E3%252582%2525A2%2525E3%252582%2525AF%2525E3%252582%2525BB%2525E3%252582%2525B7%2525E3%252583%252596%2525E3%252583%2525AB%2525E3%252581%252598%2525E3%252582%252583%2525E3%252581%2525AA%2525E3%252581%252584%2525E3%252582%2525AF%2525E3%252583%2525AA%2525E3%252583%252583%2525E3%252582%2525AF%2525E3%252582%2525A4%2525E3%252583%252599%2525E3%252583%2525B3%2525E3%252583%252588%2525E3%252582%252592%2525E7%252599%2525BA%2525E8%2525A6%25258B%2525E3%252581%252599%2525E3%252582%25258B%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3A%2525E3%252582%252586%2525E3%252581%252586%2525E3%252581%2525A6%2525E3%252582%252593%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EtL0FPaDE0R2kyUjJhZW0zYXB3MjFneHFmUGJGSlpDaG1ndEs2aG9jS0VNbV9JT3c9czI1MC1j%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)