I'm new to the prototype, but pretty experienced with jQuery, so I just don't understand how the prototype works. I am trying to do the following
$$("tr.total_line td.total_cell").first().replace(newTotal);
but i get TypeError: Cannot read property 'firstChild' of null
When I execute $$("tr.total_line td.total_cell").first()in the JS console, I get the result of the DOM element.
Here is the corresponding markup
<tr class="total_line">
<td colspan="2">Total</td>
<td class="total_cell">$50.00</td>
<td></td>
</tr>
source
share