Question: General Instructions: Create variables to store information. Use document.getElementById ( ) to get the node with the specified id . Use node.textContent = value to
General Instructions:
Create variables to store information.
Use document.getElementById to get the node with the specified id
Use node.textContentvalue to set the text content of a node.
Exercise :
In this exercise, you will create a script that calculate the cost of a sign as it is shown in figure
Edit index.html file is given to you. You should add the javaScript code as follows:
Create three variables to store information that is used in the welcome message.
Concatenate these variables to create a full message that user will see.
Create a variable called sign to hold the text that sign will display.
Create a variable called tiles that holds how many characters are in the in the sign. You can use the
length property to determine how many characters are in the string.
Calculate the cost of the sign by multiplying number of tiles by the cost of each one.
The grand total is calculated by adding $ for shipping.
Write the information to the index. tml by selecting the elements and then replacing the content of
that element select the information from the html page using the value of their id attribute and then
update the texts inside those elements.
Figure : The inde.html page after adding the javaScript code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
