BananaMaster

41.2 - How for works and what it is ( JS lessons )

If you forgot something — click to go to the lesson.

Task 1.

Create a button. On click, print the numbers from 5 down to 1 to the console.

Task 2.

Create a button. On click, print to the console all numbers from 1 to 20, except the number 10.

Task 3.

Create 2 inputs, a button and a div. In the first input the user enters a number, in the second — a text. On button click, using a loop, print the entered text into the div as many times as specified in the first input.

Task 4.

Create an input type="number" and a button. Using a loop, find the sum of all numbers from 1 to the entered number. On click, print the answer to the console.

Task 5.

Create an input type="number", a button and a div. Using a loop, on click print into the div all numbers from 1 to the entered number, except the number 5.

Task 6.

Using nested loops, draw and render into HTML:

                ABCDE
ABCDE
ABCDE
ABCDE

The code must run only on button click.

Task 7.

Using nested loops, draw and render into HTML:

12345
1234
123
12
1

The code must run only on button click.