Javascript program that will read a message string

Assignment Help Programming Languages
Reference no: EM13935576

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 https://javascript.cs.lmu.edu/playground/

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 https://javascript.cs.lmu.edu/playground/ and see what happens. The value entered in textfield input1 should be displayed 'input2' number of times."

 

Reference no: EM13935576

Questions Cloud

Descriptions of beneficial learning strategies : You should seek to present appropriate illustrations and detailed descriptions of beneficial learning strategies that you have encountered and employed.
White supremacy shape the lives of americans : Construct a definition of the terms "white privilege" and "white supremacy."  Provide an example of each, if different. Do white privilege and/or white supremacy shape the lives of Americans today? How?
Austraria or a major river in another country : students are to write a retter home to their parents expraining the water crises and arguing for or against the use of recycled water.GEOGRAPHY:
Describe five ways of getting dna into a cell : Define restriction enzymes, and outline how they are used to make recombinant DNA. Outline the PCR process and provide an example of its use.
Javascript program that will read a message string : 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.
Evaluating a companys external environment : The design of robust value-creating supply chain networks. Focused swot: diagnosing critical strengths and weaknesses and Evaluating a companys external environment
The supplies inventory : The supplies inventory on August 1, 2012 was $7,350. Supplies costing $22,150 were acquired during the year and charged to the supplies inventory. A count on July 31, 2013 indicated supplies on hand of $8,810.
What is dollar amount of cash flows that baxter will receive : Baxter plans to hedge its cash flows with a forward contract. What is the dollar amount of cash flows that Baxter will receive in five years if it accepts this project?
Identify corporate governance requirements : Identify corporate governance requirements described in the case study and in provided policy documents for the organisation. Identify corporate governance requirements described in the listed published sources of information. Page 4

Reviews

Write a Review

Programming Languages Questions & Answers

  Design an appropriate set of classes to solve the problem

The purpose of this project is for you to demonstrate your understanding of object oriented software development in practice.

  Assignment - file access and flowcharts

Assignment - File Access and Flowcharts, The Output symbol is used to output data to a text file. When an Output symbol is reached during Raptor program execution, the system determines whether or not output has been redirected

  Write computer code to compute determinant of matrix

Write computer code to compute the determinant of matrix for all n between 2 and 9. Use factoriadic numbers to create all permutations.

  Use shared mutex for synchronization and locking mechanism

Execute two programs of matrix multiplication with thread programming. Use the shared mutex for synchronization and locking mechanism.

  Design a website to allow calculation of areas

Design a website to permit calculation of areas. A radio button list can be used to allow the user select what type of area to be calculated. Once the selection is done, the input text boxes should be displayed with the proper labels.

  Explain why competition synchronization is not a problem

Explain clearly why competition synchronization is not a problem in a programming environment that supports coroutines but not concurrency.

  Create a student database in ruby

To create a student database in Ruby that allows for (i) loading an existing (or creating a new) database from a text file; (ii) adding records to the database; (iii) updating a record within the database

  Program to display contents of file in separate line

Display the contents of the file GRADES created in Problem 1. Each student's record should appear on a separate line and include the total score (the sum of the three tests) for that student.

  The student class and the examgrades class

The student type should describe student's last name, first name, id ( letter 'N' followed by an 8-digit number), gpa (a real number in the range of 0.0 to 4.0, a whole number of credits completed, and a single letter status indicating full time

  Create application to enter number of units sold

Quantity discounts are given according: create an application that allows the user to enter the number of units sold for each software package.

  Design a program that accepts a players team number

The Midville Park District maintains five soccer teams, as shown in the table. Design a program that accepts a player's team number and displays the player's team name

  Application development and programming languages

Compare and contrast object-oriented languages (Java, C++, C#, etc.) to imperative languages (C, Pascal, etc.) in terms of:

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