Easy Tutorial
❮ Api Jquery Ui Keycode Api Icons ❯

jQuery UI API - .uniqueId()

Category

Methods | UI Core

Usage

Description: Generates and applies a unique ID for the set of matched elements.

Returns: jQuery

Version Added: 1.9

This method does not accept any parameters.

Many widgets require elements to have a unique ID. .uniqueId() checks if the element has an ID; if it does not, it generates an ID and sets it as the element's ID. It is safe to call .uniqueId() without checking if the element already has an ID. When the widget needs to be cleaned up, if the ID was added by .uniqueId(), the method will remove the ID from the element; if the ID was not added by .uniqueId(), it will have no effect. .removeUniqueId() can distinguish IDs because those generated by .uniqueId() have the prefix "ui-id-".

❮ Api Jquery Ui Keycode Api Icons ❯