I am trying to use javascript to change a few bits of text on a checkout page for the shopping cart I'm stuck in.
I have the following that works for several parts that are labeled with identifiers. The problem is that one of the parts I want to change is the class, and I cannot get it to work.
Any help getting the next one to work for the class? Thanks
window.onload = function() { var str = "Price per Unit"; el = document.getElementById('pricePerUnit'); el.innerHTML = str; var date = new Date(); var hours = date.getHours(); if (hours >= 0 && hours < 24) { el.innerHTML = str.replace("Price per Unit", "Price"); } }
edit: here is the code I'm trying to change, basically I want to change $ 30 to say $ 30 + $ 5 / mo, there is only one element for this class
<td valign="top" align="center" class="unitprice"> <font size="2" face="Arial, Helvetica, sans-serif" color="">$30.00</font></td>
Jason source share