I have a JavaScript function that looks like this:
function recalculateWhatIfCurrentRate(aEle, aChangedLabel, recordID, yearEndCurrentRate) {
var rate = document.getElementById(aEle).value;
document.getElementById(aChangedLabel).value = yearEndCurrentRate * (1 + rate);
}
aEle = ctl00_cpMain_tbCurrentRatePercentIncrease_131578
aChangedLabel = ctl00_cpMain_lblScrollCurrentRate_131578
recordId = 131578
yearEndCurrentRate = 100.65
I want to change the actual text of aChangedLabel.
Why doesn’t it change in the DOM?
Label tags don’t have a value attribute, you need to set innerHTML to change the text.