BananaMaster

12.3 - innerHTML, input, select, value, querySelector, function, onclick, += (JavaScript) | JS lessons

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

Task 1.

What will be the value and data type of this expression?

'Hello ' + '2'

Task 2.

What will be the value and data type of this expression?

'10' / '2'

Task 3.

What will be the value and data type of this expression?

'' + 1 - '2'

Task 4.

Create a button and a select with options "100px" and "200px" (the option text must match the values). When a size is selected, update the button’s width accordingly.

Task 5.

Create two inputs with type="number", a div, and a button. When the button is clicked, display their sum (first + second) inside the div.

Input inp_5_1
Input inp_5_2

Task 6.

Create an input with type="color" and a button. When the value changes, update the button’s background color in real time.

Input i_6

Task 7.

Create an input with type="number" and a button. Enter a value in the input, and when the button is clicked, update the button’s width based on that value.

Input i_7