Question: Use the provided HTML file and add a basic event handler to the page so that when the button is clicked the browser alerts the

Use the provided HTML file and add a basic event handler to the page so that when the button is clicked the browser alerts the contents of the form input control added to your name and also changes the contents of the headline below the button to contain the contents of the form input control.

Process:

Start with the provided PP5.html file.

Put all JavaScript for this Lab embedded in the html file. Only turn in this one

HTML file.

Add your name and email where indicated.

Do not change the structure of the HTML other than adding your info noted

in step 3 and adding your JavaScript to the page.

Write JavaScript code to do the following things based on the demos we did

in class.

Add an event listener to the Alert Me div so that when it is clicked it

will run some code.

When the button is clicked it should do two things.

(1) It should show an Alert box with the contents of the text field in

the Alert box. I want you to also append your name and a colon (name:) before the value of the text box. For example if the text box says This is a test, I would have the Alert say Daniel Krieglstein: This is a test

(2) Also it should change the value of the h2 below the button to have the text contents of the text input control. Do not append your name to this one. Just have the exact contents of the text box.

I will show an example of this behavior in class in a final version of the lab.

Submit the HTML file to the Basecamp collection of Production Problems.

HTML FILE:

Lab 7 - Basic JavaScript Event Handling and DOM

ITMD-361 - Lab 7 - Basic JavaScript Event Handling and DOM

Your Name Here

Your email here

Alert Me

Show results here

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!