Pergunta de entrevista da empresa D2L

How would you write a text input HTML form with validation in Javascript?