# Working out the studied material for work with the DOM

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.

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.

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

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).

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.

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).

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

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.

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).

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

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

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

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

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

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.

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.

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

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.

Given an input. A number is entered into it. When focus is lost, check that it contains a number from `1` to `100`. If so, color the input into green, and if not, into red.

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

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.

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.

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.

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.

←→
↑
en ru