このテーブルを考えると:
<table border="1" width="200" id="table1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#CB2F7F">
<tr id="st_ppp">
<td width="60%" class="totalLabels">Price per piece</td>
<td width="39%" align="right" class="totalElements">unknown</td>
</tr>
<tr id="st_qty">
<td width="60%" class="totalLabels">Quantity</td>
<td width="39%" align="right" class="totalElements">unknown</td>
</tr>
<tr>
<td width="60%"> </td>
<td width="39%" align="right"> </td>
</tr>
<tr>
<td width="60%" class="subTotalLabel">Sub-Total:</td>
<td width="39%" align="right" class="subTotal">unknown</td>
</tr>
</table>
次の疑似コードのようなことをしたいと思います。
document.getElementById("st_ppp").[td whose class is totalElements].innerHTML="NewPrice";
document.getElementById("st_qty").[td whose class is totalElements].innerHTML="NewQty";
JS の操作を容易にする HTML へのその他の変更の提案も受け付けています。