How can I assign values to variables from different spans with the same ID
<p>I have many spans with the same ID. how can assign their values to different variables in order of their occurance.</p>

<p>Ex</p>

<pre><code>&lt;span id="hello"&gt; 18&lt;/span&gt;
&lt;span id="hello"&gt; 12&lt;/span&gt;
&lt;span id="hello"&gt; 21&lt;/span&gt;
</code></pre>

<p>I want var1 = 18  var2= 12  var3= 21</p>
