In this assignment, let's build a Subscribe to Us form by applying the concepts we learned till now.
Refer to the below image.
Instructions:
- Add the HTML form,input,p, andbuttonelements to the HTML code
- Add an id subscribeFormto the HTMLformelement
- Add the ids nameandemailto the HTMLinputelements respectively
- Add the ids nameErrMsgandemailErrMsgto the HTML paragraph elements respectively
By following the above instructions, achieve the given functionality.
- When the HTML input element with the id namelost the focus,
- If its value is empty, the HTML paragraph element with the id nameErrMsgshould have the error message Required* else should have an empty string.
- If its value is empty, the HTML paragraph element with the id
- When the HTML input element with the id emaillost the focus,
- If its value is empty, the HTML paragraph element with the id emailErrMsgshould have the error message Required* else should have an empty string.
Resources
Use the image URL given below.
CSS Font families used:
- Roboto
Tags:
JavaScript Practice