Code: Select all
Object.prototype.insertFirst=function(obj) {
if(this.nodeType!==undefined&&this.childNodes!==undefined) {
if(this.childNodes.length==0)
this.appendChild(obj);
else this.insertBefore(obj, this.firstChild);
}
}Cheers!
Darkzaelus