# Spot the bug - #189: Button

**URL:** <https://forum.kirupa.com/t/spot-the-bug-189-button/683982>\
**Category:** web dev\
**Created:** [November 9, 2026, 4:05pm UTC](https://forum.kirupa.com/t/spot-the-bug-189-button/683982 "2026-11-09T16:05:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HariSeldon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hariseldon/32/31261_2.png) [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Post date:** [November 9, 2026, 4:05pm UTC](https://forum.kirupa.com/t/spot-the-bug-189-button/683982/1 "2026-11-09T16:05:21Z")

</div>

A tiny web snippet with a quirky bug hiding inside.

```html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>Spot the Bug - quirky timer</title>
  <style>
    .box { width: 200px; height: 100px; background: #f0f0f0; border: 1px solid #ccc; display: flex; align-items: center; justify-content: center; }
  </style>
</head>
<body>
  <div class="box" id="box">0</div>
  <button id="start">Start</button>
  <script>
    // The goal: inner counter should update every second when started
    let count = 0;
    const box = document.getElementById('box');
    document.getElementById('start').addEventListener('click', function() {
      setInterval(function() {
        count++;
        box.textContent = count;
      }, 1000);
    });
  </script>
</body>
</html>

```

Reply with what is broken and how you would fix it.
