Design program that will read a message string

Assignment Help Computer Engineering
Reference no: EM1332368

Write a JavaScript program that will read a message string and a number from text boxes on a Web page. The program will then use those values to display some information to the user.

Use the JavaScript DHTML Playground to write JavaScript code that performs the following tasks:

- Read a message string from a text box ("Input 1").
- Read a number from a second text box ("Input 2").
- Display, in the page footer, the message string from "Input 1". Repeat the string the number of times your program read from "Input 2". Note: Convert the value from "Input 2" into an integer by using the parseInt() function.

Test the JavaScript code by clicking on the Run button. Submit a Microsoft Word document that contains your JavaScript code. Include a screenshot of the output.

Note: The JavaScript DHTML Playground is at

My instructor commented on what I did by saying this:

"You are to write JavaScript code to extract information from the form fields 'input1', 'input2', and 'footer'. You do this by looking at the HTML code (the form part). Here is an example of how to do this:

var value1 = document.getElementById("input1");
var value2 = document.getElementById("input2");
var footer = document.getElementById("footer");

You then use the value function to get the value of the field so that you can manipulate it. Next, you will need a for loop to display whatever was stored and accumulate value1 content i.e., inputstring 'count' number of times. For this you need a collector variable i.e., a variable for storing value1 content. This collector variable must be initialized to ' ' i.e.,, empty. You then assign the value of value1 'count' number of times in a for loop.

The last step is to display the result to the footer. The command to do that is as follows:

footer.innerHTML = your_collector_variable;

You should then test your code at and see what happens. The value entered in textfield input1 should be displayed 'input2' number of times."

Reference no: EM1332368

Design a function that computes a taxi fare

Write down a function that computes a taxi fare. In some cities, taxi fares are calculated based on start and end zones plus a per-minute charge. In this city, there are thr

Make a web page that contains two selection lists

Pick your favorite sport and search the internet for current roster of players for five teams. design a web page that contains two selection lists: one that displays a drop-

Find out if they can be formed into a triangle

Write down a JavaScript program that allows a user to input three integers using text boxes in a form. (Hint: You need to use the built-in parseInt function to convert the i

Comapre the advantages and disadvantages of using javascript

comapre the advantages and disadvantages of using JavaScript on the client-side. Where JavaScript is blocked or disabled, does that amount to a potentially significant busin

Write a program that reads 100 numbers

design a program in python that continually reads in numbers from the user and adds them together until the sum reaches 100. Write another program that reads 100 numbers fro

How to write a python program

design a Python program that would prompt the user for the number of employees to be entered, and then prompt for employee name, followed by wage, followed by hours worked.

Create a good design of the functions to make the best use

Write down a Python program that will first ask the number of overs each team will bat. The program then will continue to ask the score board people to input the runs for ev

Make use of a regularexpressionvalidator control

make Use of Visual Studio.NET 2005 to create an ASP.NET project with four aspx forms. Use Master Pages to display a company name selected by your group at the top each form.


Write a Review

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