BananaMaster

41.3 - 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 to the console all even numbers from 2 to 10.

Task 2.

Create an input type="number", a button and a div. On click, print into the div all numbers from 1 to the entered number. Add a <br> tag after each number.

Task 3.

Create an input type="number", a select, a button and a div. In the input the user enters a number, and in the select chooses an emoji. On button click, print the selected emoji the specified number of times.

Task 4.

Create a button. On click, find the sum of all even numbers from 1 to 50 and print the result to the console.

Task 5.

Create a select on the page. Make a loop from 1 to 10. Add <option> elements with numbers to it.

All elements must appear in the select as soon as the page loads.

Task 6.

Using nested loops, draw and render into HTML:

                54321
54321
54321
54321

The code must run only on button click.

Task 7.

Using nested loops, draw and render into HTML:

*****
****
***
**
*

The code must run only on button click.