There are also insertBefore() and insertAfter() methods but
they work in a way I found counter-intuitive.
The wrap() method is useful in some cases.
If you want to replace the HTML in a tag use html() like this: