Hands-On Project 1-5 Learning to locate and fix errors is an important skill for anyone programming in JavaScript. You have been given a web page containing several errors that need to be fixed. When fixed, the page will display the content shown in Figure 1-27. Do the following: 1. Use your code editor to open project01-05_txt.html from the HandsOnProject_01 folder. Enter your name and the date in the comment section of the document and save it as project01-05.html. 2. In the head section of the document there is a script that declares and initializes the reopenDate variable. There are two errors in this code. Fix both errors. 3. Scroll down to the script embedded within the article element. The code contains a total of four errors. Locate and fix the errors. 4. Save your changes to the file and then open the file in your web browser. Verify that the page resembles that shown in Figure 1-27. Hands-on Project 1-5 Hands-on Project 1-5
Hands-On Project 1-5
Learning to locate and fix errors is an important skill for anyone programming in JavaScript. You have been given a web page containing several errors that need to be fixed. When fixed, the page will display the content shown in Figure 1-27.
Do the following:
1. Use your code editor to open project01-05_txt.html from the HandsOnProject_01 folder. Enter your name and the date in the comment section of the document and save it as project01-05.html.
2. In the head section of the document there is a script that declares and initializes the reopenDate variable. There are two errors in this code. Fix both errors.
3. Scroll down to the script embedded within the article element. The code contains a total of four errors. Locate and fix the errors.
4. Save your changes to the file and then open the file in your web browser. Verify that the page resembles that shown in Figure 1-27.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>Hands-on Project 1-5</title> <link rel="stylesheet" href="styles.css" /> <script> let reopenDate = "September 8th"; </script> <!-- JavaScript Hands-on Project 1-5 Author: Date: Filename: project01-05.html --> </head> <body> <header> <h1> Hands-on Project 1-5 </h1> </header> <article> <script> // Create a custom reopening message Document.write["<p>We are closed for the holiday and will reopen on " + reopendate + "</p>"]; </script> </article> </body> </html>
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images