Snippet of code to generate unique IDs for HTML DOM