Question: Use your code editor to open the project 0 2 - 0 2 _ txt . html and project 0 2 - 0 2 _

Use your code editor to open the project02-02_txt.html and project02-02_txt.js files from the js02 c
project02 folder. Enter your name and the date in the comment section of each file and save them as
project02-02.html and project02-02.js, respectively.
2. Go to the project02-02.html file in your code editor and in the head section add a script element to load
the project02-02.js file, deferring the loading the external script file until the entire page is loaded. Review the
contents of the HTML file. Note that there are three input controls with the ids name,email, and phone.
Each of these controls must be filled out for the form to be submitted.
3. Go to the project02-02.js file in your code editor. Create a function named verifyForm() with no parameters.
Within the function do the following:
a. Declare the name variable equal to the value of the input control with the id name.
b. Declare the email variable equal to the value of the input control with the id email.
c. Declare the phone variable equal to the value of the input control with the id phone.
d. Insert a conditional operator that tests the truthy or falsy value of and name and email and phone using
the && operator. If the result of this conditional expression is true, use the window.alert() method to
display the message Thank you!, otherwise display the message Please fill in all fields.
4. Below the verifyForm() function insert a statement that attaches an event listener to the page element with
the id submit. When the click event occurs for this element, run the verifyForm() function.
5. Save your changes to the file and then open project02-02.html in your web browser.
6. Test the web form by clicking the Submit button with one or all the fields left blank, verifying that an alert box
with the message Please fill in all fields is displayed. Enter text in all the fields and click the Submit button,
verifying that an alert box with the message Thank you! is displayed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!