昔を思い出しながら、ピュアJSのリハビリ中・・・
Element.prototype.appendChild はあっても、Element.prototype.prependChild はない・・・脳がすっかり jQuery に甘やかされてしまったみたいです。
とりあえずこんな感じで汚染すれば良いかな?
Element.prototype.prependChild = function(el){
this.insertBefore(el, this.firstChild)
}
こう使う
parentElement.prependChild(childElement);