100 Days

Day 16 - Form events and basic REGEX


Listen Later


  • Learnt when attaching an event listener on a form, you always attach it to the 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
  • ...more
    View all episodesView all episodes
    Download on the App Store

    100 DaysBy John Aspinall