Practice on working out the jQuery library

Задание 1

Wrap all p paragraphs that contain a b tag in a div tag.

Задание 2

Find all paragraphs p with class www, prepend them with text '!', then add headings h1-h6 to these paragraphs and color these paragraphs and headings red.

Задание 3

Find all p paragraphs and replace them with a div tag with the same content.

Задание 4

Find all checkboxes on the page and disable the even ones found.

Задание 5

Set all unblocked checkboxes to <a href="/en/markup/manual/html/attr/checked/">'checked'</a>.

Задание 6

Given an element #test. Assign the text '!' to its immediate neighbor above, and the text '?' to its immediate neighbor below. Solve the problem in one chain.

Задание 7

Given an element #test. Put the text of the element #test as its immediate neighbors above and below.

Задание 8

Given an element #test. Find the closest paragraph among its neighbors above and assign it the text of the element #test.

Задание 9

Find the second li on the page, add the www class to it, wrap it inside a i tag, and after it, insert li with the text 'hello'.

Задание 10

Find the tenth li on the page, find its parent, get the parent's immediate sibling above, wrap it in <div class="www"></div>.

Задание 11

For each paragraph p, except for paragraphs with class www, add its ordinal number to the end.

Задание 12

Find all the paragraphs p and put a copy of each paragraph before it. Color the copy red and the original paragraph green.

Задание 13

Find the p paragraphs that are directly below the h2 and move each paragraph so that it is directly above the h2.

Задание 14

Find all empty paragraphs p (without text) and insert the text of the immediate neighbor above into them.

Задание 15

For the parent of the b tag, if it is an element with class www or a paragraph p, set the color to red and text size to 30px.

Задание 16

For all empty paragraphs p, put the text of the closest tag h2 at the top.

Задание 17

Given inputs with numbers. Make the inputs become squares of these numbers.

Задание 18

Given an element #test. Put the text of its immediate neighbor above it at the beginning, and the text of its immediate neighbor below it at the end.

Задание 19

Given an element #test. Find its second neighbor above and its second neighbor below. Make the found elements exchange text (the neighbor above takes the text of the neighbor below and vice versa).

Задание 20

Given an element div, select all immediate children of it that are not headings and color them red.

Задание 21

Find all paragraphs p, color them red. Then select paragraphs with class www from the found paragraphs and assign them text '!'.

Задание 22

Find all paragraphs p with class www, color them red. Then choose the first paragraph from the found ones and assign it the text '!', then choose the last one and assign it the text '?'. Solve the problem in one chain.

Задание 23

Find all the paragraphs p, put at the end of each of them the same text that is inside it (that is, the text in the paragraph will be written twice).

Задание 24

Find all paragraphs p, put at the end of each of them its ordinal number in the set.

Задание 25

Given paragraphs with numbers. Put at the end of each of them the number that is stored in it, multiplied by its ordinal number in the set.

Задание 26

Click on a paragraph p to delete its immediate neighbors above and below.

Задание 27

By clicking on a paragraph p, delete all of its neighbors from above up to the first heading h1-h6 (that is, the elements above this heading and the heading itself do not need to be deleted).

Задание 28

Click on paragraph p to remove its nearest lower neighbor with class www.

Задание 29

Click on paragraph p to delete its fifth neighbor from the bottom.

Задание 30

When you click on a paragraph p, delete its fifth neighbor from the bottom, unless it is h2.

Задание 31

When you click on a paragraph p, delete its fifth neighbor from the bottom if that neighbor does not have a b tag inside it.

Задание 32

When you click on a paragraph p, delete its fifth neighbor from the bottom, unless that neighbor is immediately after h2.

Задание 33

Given an element #test, swap this element with its immediate neighbor below.

Задание 34

Given an element #test. After its immediate neighbor below, insert a copy of our element.

Задание 35

Given an element #test, swap this element with its nearest neighbor below with class www.

Задание 36

Find all paragraphs p that, within one parent, lie between one and another h2.

Задание 37

Wrap each paragraph p outside and inside in div.

Задание 38

Find all p paragraphs whose immediate parent is not div and wrap each of them in <div class="www"></div>.

Задание 39

Find all p paragraphs. Remove their parent (make it unwrap) unless that parent is div with class www. Then wrap those paragraphs that had their parent removed in div with class zzz.

Задание 40

Find all parents of the element #test and create an array of CSS classes of these parents.

Задание 41

Find all p paragraphs that have a class attribute, and wrap each of them in a div with the same classes as the found paragraph, and remove the classes of each paragraph along with the class attribute.

Задание 42

Find all paragraphs p from #test, add the text '!' to the end of them, then exclude paragraphs with the class www from the found ones and set the color to red for the remaining ones.

Задание 43

Find all li on the page, then before the second to last one found, insert another li with the text 'item'.

Задание 44

Find all li on the page, then pick the second, third, and fourth from the end of those found and assign them the text '!'.

Задание 45

Find ol with #test and rearrange all li in it in reverse order.

Задание 46

Given an element #test. Find all its neighbors above and all its neighbors below and swap them (that is, everything that comes before the element should come after it and vice versa).

Задание 47

Get all li with class www, make them red, then find among those found those li that have class bbb and delete them. Solve everything in one chain.

Задание 48

Get all li on the page. Make the even ones you get blank and delete the odd ones.

Задание 49

Find all div tags and double their height.

Задание 50

Find the sum of the heights of all div on the page.

Задание 51

For the element #test, find the closest parent with the class www, and add a paragraph with the text '!' to the end of this parent.

Задание 52

When you click on the element #test, find its closest parent with the class www, inside this parent, find all paragraphs and color them red.

Задание 53

Color the first 10 li on the page red.

Задание 54

Color 5-th to 10-th li-th on the page red.

Задание 55

Find the last 10 li on the page, color them red. Then from those found, find the even li and wrap them inside a b tag.

Задание 56

The page contains checkboxes. Count how many of them are checked.

Задание 57

Given 5 checkboxes, make it so that after the user checks two of them, all checkboxes are disabled.

Задание 58

Make all checked checkboxes change their state to unchecked and vice versa.

Задание 59

Given input. Move the contents of the value attribute to the placeholder attribute, and delete the value attribute itself.

Задание 60

Given link. If the href attribute starts with http://, add the target="_blank" attribute to the link.

Задание 61

You are given an input where you can enter a number. Make it so that when you enter a number into this input and lose focus on the page, the checkbox with that number is searched for and becomes checked, while the other checkboxes become unchecked.

Задание 62

Given a select and radio buttons, the number of radios is equal to the number of items in the select. Make it so that when an item in the select is selected, the corresponding radio button is automatically selected (corresponds by sequence number: the first item in the list - the first radio, and so on).