How do I show the answer to this in a box??
function multiply()
{
if(total < 10000)
{
commission = total * 0.001;
}
else
{
commission = total* 0.0008;
}
if (commission<5) commission =5;
var total_commission =commission + total;
document.getElementById("commission").value = total_commission;
}
{
if(total < 10000)
{
commission = total * 0.001;
}
else
{
commission = total* 0.0008;
}
if (commission<5) commission =5;
var total_commission =commission + total;
document.getElementById("commission").value = total_commission;
}

Khargesh RajputRank #616 · 3.9K reputationPosted Mar 14, 2015, 10:10 PM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 15, 2015, 8:26 PM EDT
Hi,
I think your code is correct to show the value on page using js.
This is depending upon type of element "commission"...
If it is label then use...
document.getElementById("commission").InnerHTML = total_commission;
hope this will help you.