How to get an ID of a Div during runtime?

How to get an ID of a Div during runtime?

The unique ID of a DIV is automatically generated during run time. Is there a way to get the ID of that DIV?