我的HTML代碼如下所示Javascript來添加一個表的值
<TR Row="1" CLASS="ThemeAlignCenter">
<TD id="wrdActive_Row1" style="width: 50px"
CLASS="rdThemeDataTableCell"><SPAN id="lblactive_Row1">6</SPAN></TD>
... more rows
我想提出一個javascript在頁面的末尾添加所有lblactive_row1的值的時候曾經出現在頁(在該例子中的數目6)
編輯:多個源
<TABLE style="" border="0" CLASS="rdThemeDataTable" id="dtWardData"
cellspacing="0">
<COL id="wrdActive"></COL>
<COL id="wrdOccupied"></COL>
<TR Row="1" CLASS="ThemeAlignCenter">
<TD id="wrdActive_Row1" style="width: 50px"
CLASS="rdThemeDataTableCell"><SPAN id="lblactive_Row1">4</SPAN></TD>
<TD id="wrdOccupied_Row1" style="width: 50px"
CLASS="rdThemeDataTableCell"><SPAN id="lblOccupied_Row1">4</SPAN></TD>
</TR>
</TABLE>
<TABLE style="" border="0" CLASS="rdThemeDataTable" id="dtWardData"
cellspacing="0">
<COL id="wrdActive"></COL>
<COL id="wrdOccupied"></COL>
<TD id="wrdActive_Row1" style="width: 50px"
CLASS="rdThemeDataTableCell"><SPAN id="lblactive_Row1">6</SPAN></TD>
<TD id="wrdOccupied_Row1" style="width: 50px"
CLASS="rdThemeDataTableCell"><SPAN id="lblOccupied_Row1">2</SPAN></TD>
</TR>
</TABLE>
Repeat...
它繼續像另外的10個左右的表,所有在同一來源。編輯html是不可能的,因爲它是由第三方工具生成的。我只能在最後添加一個小腳本
在哪裏添加值? – 2011-02-03 12:06:16
其他SPAN是否有像'lblactive_Row2','lblactive_Row3'這樣的ID? – Martijn 2011-02-03 12:09:44
@martjin。沒有全部被稱爲lblactive_row1 – code511788465541441 2011-02-03 13:13:47