Skip to content

Instantly share code, notes, and snippets.

@kobitoDevelopment
Last active December 8, 2025 07:19
Show Gist options
  • Select an option

  • Save kobitoDevelopment/70a90084ee88bf7bcee75d7a39cbb4d2 to your computer and use it in GitHub Desktop.

Select an option

Save kobitoDevelopment/70a90084ee88bf7bcee75d7a39cbb4d2 to your computer and use it in GitHub Desktop.
<p id="counter-text">カウント: 0</span>
<button type="button" aria-labelledby="counter-text" id="count-button">クリックするとカウントが読み上げられるが、このテキストは無視される</button>
let count = 0;
document.addEventListener('DOMContentLoaded', () => {
const countButton = document.getElementById('count-button');
const counterText = document.getElementById('counter-text');
countButton.addEventListener('click', () => {
count++;
counterText.textContent = `カウント: ${count}`;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment