Quantcast
Channel: The New Dawn » programming
Viewing all articles
Browse latest Browse all 8

innerText for Firefox

$
0
0

Firefox doesn’t recognise innerText property. Below is the fix.

var AmountLabelControl = document.getElementById('lblAmount');

var amount;

if (AmountLabelControl.textContent) {
// Firefox...
amount = AmountLabelControl.textContent;
}
else if (AmountLabelControl.innerText) {
// IE...
amount = AmountLabelControl.innerText;
}

Thant Zin Oo


Viewing all articles
Browse latest Browse all 8

Trending Articles