code: function toggle() {
            var triggerChangeEvent = true;
            var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
  
            if (rootElement) {
              var input = $(this._element).find(Selector.INPUT)[0];
  
              if (input) {
                if (input.type === 'radio') {
                  if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
                    triggerChangeEvent = false;
                  } else {
                    var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
  
                    if (activeElement) {
                      $(activeElement).removeClass(ClassName.ACTIVE);
                    }
                  }
                }
  
                if (triggerChangeEvent) {
                  input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
                  $(this._element).trigger('change');
                }
              }
            } else {
              this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
            }
  
            if (triggerChangeEvent) {
              $(this._element).toggleClass(ClassName.ACTIVE);
            }
          }
docs: public