code: function toggle() {
            if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
              return false;
            }
  
            var parent = Dropdown._getParentFromElement(this);
            var isActive = $(parent).hasClass(ClassName.OPEN);
  
            Dropdown._clearMenus();
  
            if (isActive) {
              return false;
            }
  
            if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
  
              // if mobile we use a backdrop because click events don't delegate
              var dropdown = document.createElement('div');
              dropdown.className = ClassName.BACKDROP;
              $(dropdown).insertBefore(this);
              $(dropdown).on('click', Dropdown._clearMenus);
            }
  
            var relatedTarget = { relatedTarget: this };
            var showEvent = $.Event(Event.SHOW, relatedTarget);
  
            $(parent).trigger(showEvent);
  
            if (showEvent.isDefaultPrevented()) {
              return false;
            }
  
            this.focus();
            this.setAttribute('aria-expanded', 'true');
  
            $(parent).toggleClass(ClassName.OPEN);
            $(parent).trigger($.Event(Event.SHOWN, relatedTarget));
  
            return false;
          }
docs: public