100 Days
100 Days
John Aspinall
Day 16 - Form events and basic REGEX
18 minutes Posted May 19, 2020 at 5:19 pm.
0:00
18:24
Download MP3
Show notes


  • Learnt when attaching an event listener on a form, you always attach it to the <form> element and NOT to the button itself.
  • Learnt about using the ‘event object’ and what you can do with it
  • Prevent default 'refresh' behaviour of the submit event
  • Firefox devtools is better than Chrome here as it visually shows you when you have selected the field.
  • Get a reference to the username field and log it to the console.  Clue - use the ID of the input field.
  • Regex basics.  A regular expression (regex) is a matching pattern that only allows a certain combination or pattern of characters to be entered i.e. 4-18 characters and only containing letters and numbers
---
Send in a voice message: https://anchor.fm/100-days-code/message