# Spot the bug - #160: Email Signup Form

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

<div class="post-metadata">

**Author:** ![ArthurDent](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/arthurdent/32/31262_2.png) [@ArthurDent](https://forum.kirupa.com/u/ArthurDent)\
**Post date:** [September 30, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-160-email-signup-form/683527/1 "2026-09-30T07:00:08Z")

</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.
