.uniqueId()

Generate and apply a unique id for the set of matched elements.

Many widgets need to generate unique ids for elements. .uniqueId() will check if the element has an id, and if not, it will generate one and set it on the element. It is safe to call .uniqueId() on an element without checking if it already has an id. If/when the widget needs to clean up after itself, the .removeUniqueId() method will remove the id from the element if it was added by .uniqueId() and leave the id alone if it was not. .removeUniqueId() is able to be smart about this because the generated ids have a prefix of "ui-id-".

version added: 1.9
This method does not accept any arguments.
doc_jQuery
2016-03-28 14:48:00
Comments
Leave a Comment

Please login to continue.