JavaScript Within the script section create two global variables: one named i with a value of , and the other named listItem with its value set to an empty string.. Below the variables, create a function called processInput(). Within the function, create an if statement that runs if the value of i is less than or equal to . The ifstatement should perform the following actions: a. Set the value of the listItem variable to the string “item” concatenated with the value of i. b. Set the content of the element with an id equal to listItem to the value of the element with the id of toolbox.c. Set the value of the element with the id of toolbox to an empty string.. Before the closing } of the if statement, create a nested if statement. If the value of i is equal to , the statement should change the content of the element with the id of resultsExpl to the string “Thanks for your suggestions.”. Before the closing } of the main if statement, after the nested if statement, add a statement to increment the value of i by .. Add a backward-compatible event listener for the click event to the Submit button

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

JavaScript

Within the script section create two global variables: one named i with a value of , and the other named listItem with its value set to an empty string.. Below the variables, create a function called processInput(). Within the function, create an if statement that runs if the value of i is less than or equal to . The ifstatement should perform the following actions: a. Set the value of the listItem variable to the string “item” concatenated with the value of i. b. Set the content of the element with an id equal to listItem to the value of the element with the id of toolbox.c. Set the value of the element with the id of toolbox to an empty string.. Before the closing } of the if statement, create a nested if statement. If the value of i is equal to , the statement should change the content of the element with the id of resultsExpl to the string “Thanks for your suggestions.”. Before the closing } of the main if statement, after the nested if statement, add a statement to increment the value of i by .. Add a backward-compatible event listener for the click event to the Submit button (with the id of button).. Add comments to document your work, and then save your work. Open index.htm in a browser, type the name of a tool in the text box, and then click Submit. The name of the tool you typed is added to the bulleted list on the right side of the web page. Enter the names of four more tools, clicking Submit after each one. After you enter the fifth name, the text “Thanks for your suggestions.” is displayed below the bulleted list.

Here is the code I hve to start

My code for the solution

<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>Hands-on Project 3-4</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 3-4 </h1> </header> <article> <div id="results"> <ul> <li id="item1"></li> <li id="item2"></li> <li id="item3"></li> <li id="item4"></li> <li id="item5"></li> </ul> <p id="resultsExpl"></p> </div> <form> <fieldset> <label for="toolBox" id="placeLabel"> Type the name of a tool, then click Submit: </label> <input type="text" id="toolBox" /> </fieldset> <fieldset> <button type="button" id="button">Submit</button> </fieldset> </form> </article> </body> </html>

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education