Finding descendants of elements in JavaScript
firstElementChildlastElementChildchildrenЗадание 1
Given the element #elem:
html<ul id="elem">
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
</ul>
Find the first child of this element and make its text red.
Задание 2
Given the element #elem:
html<ul id="elem">
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
</ul>
Find the last child of this element and make its text red.
Задание 3
Given the element #elem:
html<ul id="elem">
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
</ul>
Find all the children of this element
and append the text '!'
to the end of them.