100 Days
Day 16 - Form events and basic REGEX

Episode 16 · Season 1

Day 16 - Form events and basic REGEX

100 Days

18:24

About this episode


  • 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

More from 100 Days

Started a beginners yoga course to help with RSI https://www.youtube.com/watch?v=6we3aNljJPc&list=PL-JjnyV2BH2XrgIAe9bvTLN4J0l-dz4L8&index=1 Reading and watching video series about XSS Wrote my own JS…

19m

Made my API display its data to the DOM and therefore in a functioning page Designed a dashboard, a login component in Sketch and then coded the login into a fully responsive and light/dark toggle swi…

15m

Spent all day trying to write a script to fix the line break problem, but found you could achieve the result with one line of CSS! Good old Stack Overflow to the rescue! white-space: pre-wrap; https:/…

15m

Decided to knock the official course on the top of of the head for a bit and write some little challenges that I found here: https://gomakethings.com/vanilla-js-projects-for-total-beginners/ First up,…

18m