title: add a class to specific element by javascript and not repeat
body: <p>this is sample code explain what i want: </p>
  
  <pre><code>&lt;div id="someId"&gt;
  &lt;div class="someClass"&gt;&lt;/div&gt;
  &lt;div class="targetClass"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="someId"&gt;
  &lt;div class="someClass"&gt;&lt;/div&gt;
  &lt;div class="targetClass"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="someId"&gt;
  &lt;div class="someClass"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>this code for <code>jquery</code>:</p>
  
  <pre><code>var $newDiv = $("&lt;div/&gt;")
  .addClass("targetClass")
  $(".someClass").append($newDiv);
  </code></pre>
  
  <p>result is add a TargetClass in <code>div</code> number 3 and repeat same class in first and second <code>div</code>.</p>
  
  <p>question is how i add class in the last <code>div</code> and not repeat it in another <code>div</code>. </p>