Nodejs Utililty Methods HTML Element Append

List of utility methods to do HTML Element Append

Description

The list of methods to do HTML Element Append are organized into topic(s).

Method

append(element)
HTMLElement.prototype.append = function(element){
    this.appendChild(typeof element === 'string' ?
        document.createTextNode(element) : element);
};
appendAfter(element)
Element.prototype.appendAfter = function(element) {
  return element.parentNode.insertBefore(this, element.nextSibling);
}, false;
appendBefore(element)
Element.prototype.appendBefore = function(element) {
  return element.parentNode.insertBefore(this, element);
}, false;
appendFirst(el)
HTMLElement.prototype.appendFirst = function(el) {
  if (!el) return;
  if (this.firstChild) {
    this.insertBefore(el, this.firstChild)
  } else {
    this.appendChild(el);
append(child)
HTMLElement.prototype.append = function append(child) {
    this.appendChild(child);
    return this;
};