title: Targeting DIVs without #id, Adding #id
body: <p>I'm new to JavaScript and CSS and my skills are poor at best. I have an idea how to solve my problem but I don't have the knowledge to solve it.<br>
  I have a code like this:</p>
  
  <pre><code>&lt;div class="detail"&gt;
      &lt;div class="detail-group"&gt;&lt;/div&gt;
      &lt;div class="detail-group"&gt;&lt;/div&gt;
      &lt;div class="detail-group"&gt;&lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>I have to append one <strong>existing</strong> DIV with unique #id to each one of the .detail-group DIVs. I have to specify the .detail-group even though they are exactly the same. <strong>I don't have access to the HTML to edit it manually.</strong><br>
  If I'm correct my best shot is to use JS to set IDs to those .detail-group DIVs.<br>
  I used CSS to target each one of them with this and create a difference:</p>
  
  <pre><code>.detail-group:nth-child(1) { padding-right: 0.01px }
  .detail-group:nth-child(2) { padding-right: 0.02px }
  .detail-group:nth-child(3) { padding-right: 0.03px }
  </code></pre>
  
  <p>But I don't know how to detect this difference with JS and work with it.
  Is it possible to differentiate the order of elements in JS? If there is, How to do it. And how to add IDs to them?</p>
  
  <p>A side note, I'm working with Enjin modules and thats why I don't have access to their HTML. If someone has experience in this field it will be greatly appreciated. </p>