Create a dynamic id to be used in the markup generated by the widget in order to get a reference to the
corresponding DOM element later (for example in initWidget).
@return {String}
542725
function () {
                var res = idMgr.getId();
                if (this._dynamicIds) {
                    this._dynamicIds.push(res);
                } else {
                    this._dynamicIds = [res];
                }
                return res;
            }
613119
function generateId(_ComponentStyle: Function, _displayName: string, parentComponentId: string) {
  const displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);

  /**
   * This ensures uniqueness if two components happen to share
   * the same displayName.
   */
  const nr = (identifiers[displayName] || 0) + 1;
  identifiers[displayName] = nr;

  const componentId = `${displayName}-${_ComponentStyle.generateName(displayName + nr)}`;

  return parentComponentId ? `${parentComponentId}-${componentId}` : componentId;
}
1008094
function () {
        var self = this, prefix = self.classPrefix;

        return (
          '<div id="' + self._id + '" class="' + self.classes + '">' +
          '<div id="' + self._id + '-body">' +
          self.encode(self.state.get('text')) +
          '<button role="button" tabindex="-1">' +
          '<i class="' + prefix + 'ico ' + prefix + 'i-help"></i>' +
          '</button>' +
          '</div>' +
          '</div>'
        );
      }
1229720
private static List<String> getElementsId(List<Element> elementList) {
        List<String> result = new ArrayList<String>();

        for (Element element : elementList) {
            result.add(element.getAttribute("id"));
        }

        return result;
    }
1280931
function (cfg, ctxt) {
        this.$BaseWidget.constructor.apply(this, arguments);

        /**
         * Creates a unique id to be used in the markup generated by the widget.
         * @return {String}
         */
        if (!cfg.id) {
            this._domId = this._createDynamicId();
        } else {
            this._domId = this._context.$getId(cfg.id);
        }

        /**
         * Element containing the template content
         * @protected
         * @type HTMLElement
         */
        this._subTplDiv = null;

        /**
         * Template context of the sub template.
         * @type aria.templates.TemplateCtxt
         */
        this.subTplCtxt = null;

        /**
         * Is true if a module controller instance has to be created by the template widget itself.
         * @protected
         * @type Boolean
         */
        this._needCreatingModuleCtrl = cfg.moduleCtrl && cfg.moduleCtrl.getData == null;

        /**
         * Configuration which will be sent to the template context. It is initialized with some properties in the
         * template widget constructor and completed later. It is set to null just after the template context has been
         * initialized, or if an error prevents the template from being loaded. So, if it is not null, we are still
         * waiting for the template to be loaded.
         * @protected
         * @type aria.templates.CfgBeans:InitTemplateCfg
         */
        this._tplcfg = {
            classpath : ariaCoreEnvironmentCustomizations.getTemplateCP(cfg.classpath),
            args : cfg.args,
            id : this._domId,
            moduleCtrl : cfg.moduleCtrl
        };
        // does the normalization
        this._checkCfgConsistency(cfg);

        var tplCtxt = new ariaTemplatesTemplateCtxt();
        this.subTplCtxt = tplCtxt;

        /**
         * Whether the context was already initialized or not.<br />
         * Not-initialized context means the the widget is still waiting for some dependencies to load, thus it's a
         * differed content
         * @type Boolean
         * @protected
         */
        this._initCtxDone = false;

        /**
         * Whether or not the widget is differed in its main section.<br />
         * If the context is not initialized when the markup is created this widget should be considered as differed to
         * avoid triggering $displayReady on the containg template
         * @type Boolean
         * @override
         */
        this.isDiffered = false;

        /**
         * CSS classes coming from the CSS templates associated to the template
         * @protected
         * @type String
         */
        this._cssClassNames = "";
    }
1224624
function(id) {
        if (typeof id !== "string") {
            YAHOO.log("id is not a string, assuming it is an HTMLElement");
            id = Dom.generateId(id);
        }
        this.invalidHandleIds[id] = id;
    }
570812
function () {
            var possibleVals = result(this, 'possibleVals');
            var id = this.inputId;
            var $select = Backbone.$('<' + this.elementType + '>')
                    .attr(extend((this.addId ? { id: id, name: id } : {}), this.inputAttrs));

            this.getInputWrapper().html($select);
            if (this.multiple) { $select.attr('multiple', 'multiple'); }
            if (this.inputClass) { $select.addClass(this.inputClass); }
            if (this.placeholder) {
                $select.append('<option value="">' + this.placeholder + '</option>');
            }
            return this._renderInput($select, possibleVals);
        }
205790
public function generateId()
    {
        if ($this->idAttributeType == static::$idTypeInteger) {
            do {
                $result = Number::randomNumber($this->idAttributePrefix, $this->idAttributeLength);
            } while ($this->checkIdExists((int) $result));
            return $result;
        }
        if ($this->idAttributeType == static::$idTypeString) {
            return $this->idAttributePrefix .
                Yii::$app->security->generateRandomString($this->idAttributeLength - strlen($this->idAttributePrefix));
        }
        if ($this->idAttributeType == static::$idTypeAutoIncrement) {
            return null;
        }
        return false;
    }
736884
function setId(element, id) {
    const currentId = getAttribute(element, 'id');

    if (currentId) {
        return currentId;
    }

    const newId = id || (`mui-id-${generateRandomString(6)}`);

    setAttribute(element, 'id', newId);

    return newId;
}
679478
function() {
            var element = this._element;
            while (element.parentNode) {
                element = element.parentNode;
                if (element.$widget) {
                    return element.$widget;
                }
            }
            return null;
        }
1064570
def getElementById(id: str) -> Optional[Node]:
    """"""
    elm = Element._elements_with_id.get(id)
    return elm
1253574
function id() {
		return ($id = Promise::now($this->_id)) ? $this->_id = $id : $id;
	}
1325475
function createRecurrenceid() {
    $cnt = count( $this->recurrenceid );
    if( 0 >= $cnt )
      return;
    $formatted  = $this->_format_date_time( $this->recurrenceid['value'] );
    $attributes = $this->_createParams( $this->recurrenceid['params'] );
    return $this->_createElement( 'RECURRENCE-ID', $attributes, $formatted );
  }
1263022
public String getId() {
        Pattern replace = Pattern.compile("\\W+");
        return StringUtils.defaultIfEmpty(id, replace.matcher(getName()).replaceAll(""));
    }
690920
Element getElementById(String name) {
        for (Attr attr : attributes) {
            if (attr.isId() && name.equals(attr.getValue())) {
                return this;
            }
        }

        /*
         * TODO: Remove this behavior.
         * The spec explicitly says that this is a bad idea. From
         * Document.getElementById(): "Attributes with the name "ID"
         * or "id" are not of type ID unless so defined.
         */
        if (name.equals(getAttribute("id"))) {
            return this;
        }

        for (NodeImpl node : children) {
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                Element element = ((ElementImpl) node).getElementById(name);
                if (element != null) {
                    return element;
                }
            }
        }

        return null;
    }
237341
function uniqueId() {
  var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id_';
  var id = prefix + strRand();
  if (!store.uniqueId) store.uniqueId = {};
  var generatedIds = store.uniqueId;

  if (document.getElementById(id) || generatedIds[id]) {
    return uniqueId(prefix);
  } else {
    generatedIds[id] = true;
    return id;
  }
}
561934
private String getValueForId(String id) {
        for (int k = 0; k < fieldset.getWidgetCount(); k++) {
            Widget widget = fieldset.getWidget(k);
            if (id.equals(widget.getElement().getAttribute("id")))
                return widget.getElement().getAttribute("value");
        }
        return null;
    }