Nodejs HTML Element Append append(element)

Here you can find the source of append(element)

Method Source Code

HTMLElement.prototype.append = function(element){
    this.appendChild(typeof element === 'string' ?
        document.createTextNode(element) : element);
};

Related

  1. appendAfter(element)
    Element.prototype.appendAfter = function(element) {
      return element.parentNode.insertBefore(this, element.nextSibling);
    }, false;
    
  2. appendBefore(element)
    Element.prototype.appendBefore = function(element) {
      return element.parentNode.insertBefore(this, element);
    }, false;
    
  3. appendFirst(el)
    HTMLElement.prototype.appendFirst = function(el) {
      if (!el) return;
      if (this.firstChild) {
        this.insertBefore(el, this.firstChild)
      } else {
        this.appendChild(el);
    
  4. append(child)
    HTMLElement.prototype.append = function append(child) {
        this.appendChild(child);
        return this;
    };