Api Uniqueid
# jQuery UI API - .uniqueId()
## Category
(#) | (#)
## Usage
**Description:** Generates and applies a unique ID to the set of matched elements.
**Returns:** (http://api.jquery.com/Types/#jQuery)
**Added in version:** 1.9
.uniqueId()
This method does not accept any arguments.
Many widgets require elements to have unique IDs. `.uniqueId()` checks if an element has an ID; if it does not, it generates one and sets it as the element's ID. It is safe to call `.uniqueId()` without first checking if the element has an ID. When a widget needs to be cleaned up after use, if the ID was added via `.uniqueId()`, the `.removeUniqueId()` method will remove the ID from the element. If the ID was not added via `.uniqueId()`, it will have no effect. `.removeUniqueId()` can distinguish IDs because those generated by `.uniqueId()` are prefixed with `"ui-id-"`.
YouTip