Create a program that writes user input from a text box

Assignment Help JAVA Programming
Reference no: EM131876641

Assignment: JAVASCRIPT PROGRAMING

In this exercise, you will create a program that writes user input from a text box to a list on the web page. Your program will also write a than-you message to the page after the user has entered five items. Finally, you will create an event listener for the Submit button.

1-In your text editor, open index.htm from the files provided by your instructor. Enter your name and today's date where indicated in the comment section in the document head.

2-At the bottom of the document, before the closing </body> tag, create a script section.

3-Withing the script section create two global variables: one named i with a value of 1, and the other named listItem with its value set an empty string.

4-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 5. The if statement 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 of toolbox.
c-Set the value of the element with the id of toolbox to an empty string.

5-Before closing the } of the if statement, create a nested if statement. If the value of i is equal to 5, the statement should change the content of the element with the id of resultExpl to the string "Thank you for your suggestions."

6-Before closing the } of the main if statement, after the nested if statement, add a statement to increment the value of i by 1.

7-Add an event listener for the click event of the Submit button (with the id of button).

8-Add comments to document your work, and then save your work. Open index.html 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 you for your suggestions." is displayed below the bullted list, as shown in the Figure below.

9-Fix any errors in your code until it works as you expect.

Attachment:- Project-Assignment.rar

Reference no: EM131876641

Questions Cloud

Determine the contractors fee : A new commercial development is planned. A design-build approach will be used as the project delivery system.
What problems can occur in a continuous-media system : What problems can occur in a continuous-media system if data is delivered either too slowly or too fast?
Determine the number of operating hours : E & T Excavation Company is planning an investment of $466,600 for a bulldozer. The bulldozer is expected to operate for 2,000 hours per year for 10 years.
Plot the deseasonlized data on the same graph : Deseasonlize car sales. Plot the deseasonlized data on the same graph as the original data. Comment on the two graphs.
Create a program that writes user input from a text box : Assignment: JAVASCRIPT PROGRAMING- In this exercise, you will create a program that writes user input from a text box to a list on the web page.
Write a function that takes no input parameters : Write a function that takes no input parameters and returns nothing (void). Inside the function, create a variable of type int, and give that variable a value.
What will be the average annual cost of ownership : What will be the average annual cost of ownership during the next five years if interest is 6%?
Find the service level : A news-stand buys a weekly magazine from a publisher once every week at $3 per copy. It sells the magazine at $5 per copy.
Would you trust a neural network with your life : Would you trust a neural network with your life? For instance, would you get in a plane about to be flown by a neural network?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write various bindings to determine semantics

Write the various bindings that are required to determine the semantics when statement is executed. For each binding, indicate binding time used for language. Describe your answer.

  Generate an amortization schedule

The applet input will be the loan amount, annual percentage rate (APR), and the number of years to pay out the loan. The output will be the loan amount, interest rate per pay period number of pay periods and the monthly payment

  Develop test and execute a graphic application using java

What will be accomplished- Develop, test, and execute a graphic application using Java. Create a Java application. Given a set of events, choose the appropriate programming actions

  Class that displays your favorite movie quote

Write, compile, and test a class that displays your favorite movie quote, the movie it comes from, the character who said it, and the year of the movie.

  Creating unified modeling language based diagrams

OMSCS 6310 – Software Architecture & Design Your requirement for this assignment includes creating Unified Modeling Language (UML) based diagrams

  Print the number of lines the number of words

a java program where im supposed to print the number of lines the number of words and the longest line in a text file!

  Create a simple 2d predator-prey simulation.

The goal for this programming project is to create a simple 2D predator-prey simulation. In this simulation the prey are ants and the predators are doodlebugs. These critters live in a world composed of a 20x20 grid of cells.

  Write a program that converts a temperature

Write a program that converts a temperature given in Celsius to Fahrenheit. Test the program by performing a compile-time initialization of 32.

  Create a testrectangle class that tests both constructors

An overloaded constructor that takes integer width and height arguments, uses a separate method to check whether the width and height fall within the range between 0 and 30, and throws an exception if out of range.

  Write a program to test your class definition

Do not define an input method. The only method that can set the counter is the one that sets it to zero. Write a program to test your class definition.

  Write a java program that asks the user for his/her gender

According to researchers at Stanford Medical School, the ideal weight for a woman is found by multiplying her height in inches by 3.5 and subtracting 108.

  Design a class named cryptgram java with given requirements

Design a class Named CryptGram.java with given requirements: Data Members: a Letter array named orderedFrequency to store frequency of 26 alphabetic letters.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd