Latest web development tutorials

jQuery UI API - .uniqueId ()

category

Method (in Methods) | the UI core (UI Core)

usage

Description: In order to generate a set of matched elements and apply a unique Id.

Returns: the jQuery

New version: 1.9

.uniqueId()

This method does not accept any parameters.

Many small parts needed elements to generate unique id. .uniqueId() whether there are elements will check id, if there is no element id, it will generate a id, and set the id of the element. Without checking whether the element has the id is called .uniqueId() is safe. When widget uses need to be cleared if the id by .uniqueId() to add, .removeUniqueId() method will be removed from the id element, if not by id .uniqueId() to add, was not affected. .removeUniqueId() has been able to distinguish between id, because .uniqueId() generated id with the prefix "ui-id-" .