Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this chapter you learned how to dynamically change an image using the getElementById ( ' id ' ) . src expression along with the

In this chapter you learned how to dynamically change an image using the getElementById('id').src
expression along with the onclick event handler. In this project you will use the onclick event handler to
automatically fill delivery address input boxes with preassigned values using the expression:
document.getElementById('id').value = variable;
where id is the value of the id attribute of a web form element and variable is the variable value to write
into the element. A preview of the completed project is shown in Figure 1-26.
Do the following:
1. Use your code editor to open project01-04_txt.html and project01-04_txt.js from the js01 c project04
folder. Enter your name and the date in the comment section of each document and save them as
project01-04.html and project01-04.js, respectively.
2. Go to the project01-04.js file in your code editor. Below the comment section declare the following variables and
initial values: homeStreet 51 Main St., homeCity 5Sicilia, homeState 5MA, homeCode 502103,
workStreet 515 Oak Ln., workCity 5Central City, workState 5MA, workCode 502104.
3. Close the file, saving your changes.
4. Go to the project01-04.html file in your code editor. Directly below the closing tag insert a script
element accessing the project01-04.js file. Do not include the defer or async attributes so that the code in the
external file loads as the HTML is loaded.
5. Directly below the closing
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Fundamentals

Authors: Itzik Ben Gan

4th Edition

0138102104, 978-0138102104

More Books

Students also viewed these Databases questions