Insert elements before JavaScript elements

insertBefore
Задание 1

Given the element #elem:

html<ul id="parent">
  <li>text</li>
  <li>text</li>
  <li id="elem">text</li>
  <li>text</li>
  <li>text</li>
</ul>

Insert an element before this element with the text 'new'.

Задание 2

Modify the previous task so that clicking on the inserted element causes '!' to be added to the end of its text.