I'm using innerText to update values on a quote page when the user click certain checkboxes and i need to know if there is a straightforward alternative to using the IE compatible innerText method in Firefox?
Here is the function that uses the innerText method:
Code:
function setText(pItem, pValue)
{
var y;
var z;
y = document.getElementById(pItem);
z = y.innerText;
if (z == pValue)
{
y.innerText = 0;
if (pItem == 'adb') totalABD = 0;
if (pItem == 'pai') totalPAI = 0;
if (pItem == 'hcp') totalHCP = 0;
// Start:
if (pItem == 'ho1') totalHO1 = 0;
if (pItem == 'ho2') totalHO2 = 0;
// End:
}
else {
y.innerText = pValue;
}
// Start:
grandTotal = parseFloat(totalABD) + parseFloat(totalPAI) + parseFloat(totalHCP) + parseFloat(totalHO1) + parseFloat(totalHO2);
// End
AngrandTotal =(parseFloat(totalABD) + parseFloat(totalPAI) + parseFloat(totalHCP) + parseFloat(totalHO1) + parseFloat(totalHO2)) * 12;
z = document.getElementById('total');
z.innerText = round(grandTotal);
z1 = document.getElementById('Antotal');
z1.innerText = round(AngrandTotal);
}
Here is how the function is called when clicking on one of the checkboxes:
Code:
<input id="pai_StdSin" type="checkbox" name="pai_StdSin" onClick="javascript:setText('pai', '<%= (session.getAttribute("PricePAStdSin") == null)?"":session.getAttribute("PricePAStdSin") %>');" value="Checked">
So any ideas what alternative method can be used for Firefox browsers?