This is a solution to the Newsletter sign-up form with success message from Frontend Mentor.
- HTML
- CSS
- JS
Creating the application using the command line.
npm create vite@latest -- --template vanilla app
cd app
npm install
npm install validator
npm run dev
I learned to use the library. It is the first time ever that I have used an npm library to implement a function to my website. It was very useful and was easy to implement.
Add the app.js
file to the HTML using the script
tag.
Import the library.
Add the submit
event to the form and use Validator to check whether the value of the input
is correctly formatted as an email.