Selecting the elements in an html array

Selecting the elements in an html array

Hi,  I want to select the elements in an html array in order and give them an id. I tried for a long time but I could not. 

For example, I want to give an id to all the elements in ".dropdown".