Hi guys, please tell me how to add the method wrapper.getHtml() to the beginning of the body before script. document.write adds
class HtmlElement { TagName = ''; isTagSelfClose = false; text = ''; arrAttributies = []; arrStyles = []; arrTag = []; constructor(tagName, isTagSelfClose, text = undefined) { this.tagName = tagName; this.isTagSelfClose = isTagSelfClose; this.text = text; this.arrAttributies = []; this.arrStyles = []; this.arrTag = []; } setAttributies(value) { this.arrAttributies.push(value); } setStyle(value) { this.arrStyles.push(value); } setTagInEnd(value) { this.arrTag.push(value); } setTagInBegin(value) { this.arrTag.unshift(value); } getStringTags() { let stringTags = ""; for (let i = 0; i < this.arrTag.length; ++i) { stringTags += `${this.arrTag[i].getHtml()}`; if (i != this.arrTag.length - 1) { stringTags += "\n"; } } return stringTags; } getStringAttributies() { let stringAttributies = ""; for (let i = 0; i < this.arrAttributies.length; ++i) { stringAttributies += `${this.arrAttributies[i].name}=${this.arrAttributies[i].value}`; if (i != this.arrAttributies.length - 1) { stringAttributies += " "; } } return stringAttributies; } getStringStyles() { let stringStyles = `style=`; for (let i = 0; i < this.arrStyles.length; ++i) { stringStyles += this.arrStyles[i].name + ':' + this.arrStyles[i].value + ";"; } return stringStyles; } getHtml() { if (this.isTagSelfClose) { return (`<${this.tagName} ${(this.arrAttributies.length > 0) ? this.getStringAttributies() : +''} ${(this.arrStyles.length > 0) ? this.getStringStyles() : +''}/>`); } else { return (`<${this.tagName} ${(this.arrAttributies.length>0)?this.getStringAttribu