Internet Explorer has a property called uniqueID
that generates a unique id. This shim provides the same functionality to other browsers.
Retrieves an autogenerated, unique identifier for the object.
var id = object.uniqueID
When you apply this property to the document object, the client automatically generates a new ID that you can assign to an element's id property.
A new ID is generated and assigned to the element the first time the property is retrieved. Every subsequent access to the property on the same element returns the same ID.
Note The unique ID generated is not guaranteed to be the same every time the document is loaded.