And what would you actually do with this unique id? Not much point in applying an id unless you later try doing some sort of javascript query on it. In which case your javascript code would also need to know the id?
Understanding the intended usage of the id will make it easier to suggest how to generate one. If indeed it make sense to do so.