Nodejs HTML Element Toggle toggleDisplay()

Here you can find the source of toggleDisplay()

Method Source Code

Element.prototype.toggleDisplay = function() {
   if (this.style.display != "")
      this.style.display = "";
   else/*w  w  w.j a  va2s  . c  om*/
      this.style.display = "none";
}

Related

  1. toggleAttribute(name, value = "")
    Element.prototype.toggleAttribute = function(name, value = "") {
      if ( this.hasAttribute(name) ) {
        this.removeAttribute(name);
      else {
        this.setAttribute(name, value);
    String.prototype.ucFirst = function() {
    ...
    
  2. toggle()
    HTMLElement.prototype.toggle = function toggle() {
        this.style.visibility = (this.style.visibility === "hidden") ? "visible" : "hidden";
    };