mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-04-03 04:25:53 +02:00
15 lines
302 B
JavaScript
15 lines
302 B
JavaScript
// pseudocode
|
|
// Mixed concerns make code hard to maintain
|
|
const button = document.querySelector('button');
|
|
let count = 0;
|
|
|
|
button.addEventListener('click', () => {
|
|
count++;
|
|
document.querySelector('p').textContent =
|
|
'Clicked ' + count + ' times';
|
|
|
|
if (count > 10) {
|
|
button.disabled = true;
|
|
}
|
|
});
|