Update class name in duplicate html tags
<p>I have 2 div shown in below with same id,</p>

<pre><code>&lt;div id="dv1" class="oldClass"&gt;Div 1&lt;/div&gt;

&lt;div id="dv1" class="oldClass"&gt;Div 2&lt;/div&gt;
</code></pre>

<p>I need add class attribute using java script and i had implemented shown in below,</p>

<pre><code>var lstObj = document.getElementsByClassName(“oldClass”);
for (var i = 0; i &lt; lstObj.length; i++) {
jQuery("#" + lstObj[i].id).addClass("highlight");
}
</code></pre>

<p>but every time assign in only 1st div shown in below,</p>

<pre><code>&lt;div id="dv1" class="oldClass highlight"&gt;Div 1&lt;/div&gt;
&lt;div id="dv1" class="oldClass"&gt;Div 2&lt;/div&gt;
</code></pre>

<p>i need add “highlight” class in both div. Please help me.
Also please refer below link,</p>

<p>Please refer below link,</p>

<p>[https://forum.jquery.com/topic/update-class-name-in-duplicate-html-tags]</p>

<p>Regards,
Nirav </p>
