BananaMaster

26.3 - switch, case, default, if, else if, else, oninput ( JS lessons )

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

Task 1.

Create an input type="number", a button, and a div. If the age is less than 18 — display "child", otherwise "adult".

Task 2.

Create an input type="range" and a div. When the value changes, update the height of the div in pixels.

Task 3.

Create an input type="number" and a div. When typing, display the number multiplied by 2 inside the div (in real time).

Task 4.

Create an input type="text", a button, and a div. If "admin" or "boss" is entered — display "access", otherwise "deny".

Task 5.

Create a select with options "mon", "tue", "wed", a button, and a div. When clicked, display the day number: mon — 1, tue — 2, wed — 3.

Task 6.

Create an input type="text" and a div. If "on" is entered — set the div background to green, if "off" — red, otherwise — white.

status

Task 7.

Create a "Like" button and a div. On each click, increase the like counter. If the number of likes is greater than 10 — change the text color to green.

0