InnerText Property not Supported in Firefox

Firefox does not support the innerText property. How the innerText property work in Firefox.

If you are using innerText property like this.

document.getElementsByTagName('span')[0].innerText = "my text";

It is possible that the above line would not make run in Firefox browser.

Well, in short, Firefox does not support the innerText property. Instead, it supports the textContent property.

You can use textContent property to make it compatible with Firefox.

document.getElementsByTagName('span')[0].textContent = "my text";

But, using document.all you can also determine when to use innerText or textContent.

Example:

if (document.all)
{
 document.getElementsByTagName('span')[0].innerText = "my text";
}
else
{
  document.getElementsByTagName('span')[0].textContent = "my text";
}