Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JavaScript is the programming language of the Web. It works alongside HTML and CSS and is used mainly to make webpages interactive. Initially it was

JavaScript is the programming language of the Web. It works alongside HTML and CSS and is used mainly to make webpages interactive. Initially it was only implemented as client-side in web browsers, JavaScript engines are now embedded in many other types of host software, including server-side in web servers and databases, and in non-web programs such as word processors and PDF software, and in runtime environments that make JavaScript available for writing mobile and desktop applications, including desktop widgets.

To practice JavaScript, go to the following webpage: https://www.w3schools.com/js/tryit.asp?filename=tryjs_whereto

On your page, you will see a page that looks like the following.

image text in transcribed

You will be working in the editor area; this area is where you will be adding your script. But first, complete the following steps:

1. Click the Run button located at the top of the editor screen. In the display window, you will see the output My First JavaScript. In this script, JavaScript is using a combination of different statements to output is equivalent to the print statement that has been used in pseudocode.

2. Remove all the content from the editor window.

3. Add the script below. For accuracy, it is best to copy and paste the code into the editor window.

4. Commented lines start with the // symbol. This script doesnt have any comments. You will add comments by going to the line below the tag, and include comments with your name, the date and M13 Engage: Discussion Board.

5. Click the Run button located at the top of the editor screen.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

var text = ""

var a = 0;

var b = 0;

do {

b=a;

do {

text += " " + b;

b = b - 1;

}

while (b >= 0);

text += " ";

a = a + 1;

}

while (a

document.getElementById("demo").innerHTML = text;

This script is a simple example of a nested loop. When executed, this script will produce a countdown from 9 to 0 in decrements of 1. Note that the loop operates in the same manner as the loops that have been discussed in this course. Now, you will modify the script to countdown from 100 to 0 in decrements of 5.Once you are done, take a screenshot of your browser showing your script and your output in the display window.

Run IDOCTYPE html> kbody> JavaScript in Bodv My First JavaScript

JavaScript in Body

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions