Working out the studied material for work with the DOM

Задание 1

Given an input and a paragraph. When focus is lost on an input, write the value of the input to the end of the paragraph text.

Задание 2

Given several inputs, a paragraph and a button. By pressing the button, get the numbers in these inputs and write their sum in a paragraph.

Задание 3

Input is given. A number is entered into it. After losing focus, find the sum of the digits of this number.

Задание 4

Input is given. Enter numbers separated by commas in it. By loss of focus, find the arithmetic mean of these numbers (the sum divided by their quantity).

Задание 5

Given 4 inputs. In the first input, enter the full name separated by a space. When focus is lost, write down the last name, first name and patronymic in the remaining 3 inputs.

Задание 6

Given an input. The full name is entered into it, separated by a space. Full name is entered with a small letter. Make it so that when the input loses focus, the entered last name, first name and patronymic will automatically become capitalized (in the same input).

Задание 7

Given an input. Text is entered into it. By losing focus, find out the number of words in this text.

Задание 8

Given an input. The date is entered into it in the format 31.12.2016. When focus is lost, put this date in the format 2016-12-31 in the same input.

Задание 9

Given an input. The word is entered into it. By clicking on the button, check that this word is read from the beginning and from the end in the same way (for example, madam).

Задание 10

Given an input. A number is entered into it. Check by loss of focus that this number contains the number 3 inside it.

Задание 11

Given a few paragraphs and a button. By clicking on the button, write down at the end of each paragraph its ordinal number.

Задание 12

Links are given. Add to the end of each link its href in parentheses.

Задание 13

Links are given. If the link starts with http://, add an → (it's done like this: →) to its end.

Задание 14

Several paragraphs with numbers are given. By clicking on any paragraph, write in it the square of the number that it contains.

Задание 15

Given an input. The date is entered into it in the format 31.12.2016. By losing focus, find out the day of the week (in a word) that falls on this date.

Задание 16

Given an input. Implement buttons +1, -1 that will increment or decrement the input value by 1. Make it such a way that this value cannot become less than zero.

Задание 17

Given an input. Given paragraphs. Let the total number of clicks on these paragraphs be written in this input.

Задание 18

There are divs on the page. They have a text. Go through all the divs and cut off the texts so that they become 10 characters long. And add an ellipsis to the end of the truncated texts.

Задание 19

Given an input and a button. By pressing the button, generate a random string of 8 characters and write it to the input.

Задание 20

Given an input and a button. The user enters some string into the input. By pressing the button, mix the entered characters randomly and write it back to the input.

Задание 21

Given an input, a button, and a paragraph. The input is the temperature in degrees Fahrenheit. By clicking on the button, display the temperature in degrees Celsius in the paragraph.

Задание 22

Given an input, a button, and a paragraph. A number is entered into the input. On pressing the button, print the factorial of this number in the paragraph.

Задание 23

Given 3 inputs, a button, and a paragraph. The coefficients of the quadratic equation are entered into the inputs. By pressing the button, find the roots of this equation and display them in a paragraph.