# Spot the bug - #159: Email Signup Form

**URL:** <https://forum.kirupa.com/t/spot-the-bug-159-email-signup-form/683515>\
**Category:** web dev\
**Created:** [September 29, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-159-email-signup-form/683515 "2026-09-29T07:00:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![VaultBoy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vaultboy/32/31832_2.png) [@VaultBoy](https://forum.kirupa.com/u/VaultBoy)\
**Post date:** [September 29, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-159-email-signup-form/683515/1 "2026-09-29T07:00:09Z")

</div>

Can you spot the form bug?

```html
<form>
  <label>Email</label>
  <input type="email" id="email">
  <button type="submit">Join</button>
</form>
<script>
  document.querySelector('form').addEventListener('submit', (e) => {
    if (!email.value.includes('@')) alert('invalid');
  });
</script>

```

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