-
-
Save kobitoDevelopment/70a90084ee88bf7bcee75d7a39cbb4d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p id="counter-text">カウント: 0</span> | |
| <button type="button" aria-labelledby="counter-text" id="count-button">クリックするとカウントが読み上げられるが、このテキストは無視される</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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