Question: in the following java script code follow the instructions provided Hands-on Project 5-2 Hands-on Project 5-2 Change of address form Street Address City State/Province Zip/Postal

in the following java script code follow the instructions provided

Hands-on Project 5-2

Hands-on Project 5-2

Change of address form

1. Within the body section, just before the closing tag, add a script element, and then add the following function within the script element:

function processInput() {

var propertyWidth = 300;

var propertyHeight = 100;

var winLeft = ((screen.width - propertyWidth) / 2);

var winTop = ((screen.height - propertyHeight) / 2);

var winOptions = "width=300,height=100";

winOptions += ",left=" + winLeft;

winOptions += ",top=" + winTop;

window.open("confirm.htm", "confirm", winOptions);

}

2. Below the function you added in Step , add the following function to create an event listener:

function createEventListener() { var submitButton = document.getElementById("submit");

 if (submitButton.addEventListener) { 
 submitButton.addEventListener("click", processInput, false); 

} else if (submitButton.attachEvent) {

submitButton.attachEvent("onclick", processInput);

}

}

3. Below the function you created in Step , add the following code to create the event listener when the page finishes loading:

if (window.addEventListener) {

window.addEventListener("load", createEventListener, false); 

}

else if (window.attachEvent) { window.attachEvent("onload", createEventListener); 

}

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!