Implement the classes Input
, EmailInput
, PhoneInput
, and Form
so that the code in main.js
works. You should modify input.js
, email-input.js
, phone-input.js
, and form.js
respectively. You must not modify main.js
or index.html
.
The scripts should display a form with four fields and a submit button on the page. When the user correctly enters all the data and hits the button, the data should be printed to the console (see lines 22-27 in main.js
). Otherwise (if the name or email is not specified, or either the email or phone is not in the correct format) it should instead print the name of the field with the invalid input (see lines 29-31).