code: function () {
              var element=this.opts.element, select2 = element.data("select2"), self = this;
  
              this.close();
  
              if (element.length && element[0].detachEvent) {
                  element.each(function () {
                      this.detachEvent("onpropertychange", self._sync);
                  });
              }
              if (this.propertyObserver) {
                  this.propertyObserver.disconnect();
                  this.propertyObserver = null;
              }
              this._sync = null;
  
              if (select2 !== undefined) {
                  select2.container.remove();
                  select2.liveRegion.remove();
                  select2.dropdown.remove();
                  element
                      .removeClass("select2-offscreen")
                      .removeData("select2")
                      .off(".select2")
                      .prop("autofocus", this.autofocus || false);
                  if (this.elementTabIndex) {
                      element.attr({tabindex: this.elementTabIndex});
                  } else {
                      element.removeAttr("tabindex");
                  }
                  element.show();
              }
  
              cleanupJQueryElements.call(this,
                  "container",
                  "liveRegion",
                  "dropdown",
                  "results",
                  "search"
              );
          }
docs: abstract