Over a million developers have joined DZone.

Object.innerText For IE And FF

·

function getInnerText(elt) {
	var _innerText = elt.innerText;
	if (_innerText == undefined) {
  		_innerText = elt.innerHTML.replace(/<[^>]+>/g,"");
	}
	return _innerText;
}

Then, replace:
var text = elt.innerText;
by:
var text = getInnerText(elt);
Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}