Question: How can I implement [prepend](http://api.jquery.com/prepend/) and [append](http://api.jquery.com/append/) with regular JavaScript without using jQuery?

Answer: 
I added this on my project and it seems to work:

```
HTMLElement.prototype.prependHtml = function (element) {
    const div = document.createElement('div');
    div.innerHTML = element;
    this.insertBefore(div, this.firstChild);
};

HTMLElement.prototype.appendHtml = function (element) {
    const div = document.createElement('div');
    div.innerHTML = element;
    while (div.children.length > 0) {
        this.appendChild(div.children[0]);
    }
};

```

Example:

```
document.body.prependHtml(`<a href="#">Hello World</a>`);
document.body.appendHtml(`<a href="#">Hello World</a>`);

```
```
var insertedElement = parentElement.insertBefore(newElement, referenceElement);

```

If referenceElement is null, or undefined, newElement is inserted at the end of the list of child nodes.

```
insertedElement The node being inserted, that is newElement
parentElement The parent of the newly inserted node.
newElement The node to insert.
referenceElement The node before which newElement is inserted.

```

Examples can be found here: [Node.insertBefore](https://developer.mozilla.org/en-US/docs/Web/API/Node.insertBefore)