Prepend to an element

Add the ele element to the beginning of the target element:

target.insertBefore(ele, target.firstChild);

More

Previous
Measure the width of given text of given font
Next
Prevent body from scrolling when opening a modal