Javascript parse html add values of a table
<p>my HTML code looks like this</p>

<pre><code>    &lt;TABLE style="" border="0" CLASS="rdThemeDataTable" id="dtWardData"
                cellspacing="0"&gt;
                &lt;COL id="wrdActive"&gt;&lt;/COL&gt;
                &lt;COL id="wrdOccupied"&gt;&lt;/COL&gt;
                &lt;TR Row="1" CLASS="ThemeAlignCenter"&gt;
                    &lt;TD id="wrdActive_Row1" style="width: 50px"
                        CLASS="rdThemeDataTableCell"&gt;&lt;SPAN id="lblactive_Row1"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;
                    &lt;TD id="wrdOccupied_Row1" style="width: 50px"
                        CLASS="rdThemeDataTableCell"&gt;&lt;SPAN id="lblOccupied_Row1"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;
                &lt;/TR&gt;
            &lt;/TABLE&gt;

   &lt;TABLE style="" border="0" CLASS="rdThemeDataTable" id="dtWardData"
                cellspacing="0"&gt;
                &lt;COL id="wrdActive"&gt;&lt;/COL&gt;
                &lt;COL id="wrdOccupied"&gt;&lt;/COL&gt;

                    &lt;TD id="wrdActive_Row1" style="width: 50px"
                        CLASS="rdThemeDataTableCell"&gt;&lt;SPAN id="lblactive_Row1"&gt;6&lt;/SPAN&gt;&lt;/TD&gt;
                    &lt;TD id="wrdOccupied_Row1" style="width: 50px"
                        CLASS="rdThemeDataTableCell"&gt;&lt;SPAN id="lblOccupied_Row1"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;

                &lt;/TR&gt;
            &lt;/TABLE&gt;

    Repeat...
</code></pre>

<p>it goes on like that for another 10 or so tables, all in the same source. editting the html is out of the question because its generated by a third party tool. all i need is add a little script at the end to add all the values of lblactive_Row1 (4 and 6 in this example)</p>
