<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: JavaScript innerText and textContent</title>
	<atom:link href="http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/feed" rel="self" type="application/rss+xml" />
	<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html</link>
	<description>From Cody Taylor.</description>
	<lastBuildDate>Thu, 13 Oct 2011 06:41:44 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: RLM</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-5131</link>
		<dc:creator>RLM</dc:creator>
		<pubDate>Thu, 05 May 2011 14:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-5131</guid>
		<description>If you checkout the YUI.dom implementation they go with this. Saves having to run checks each time the function is called.

var getText = (document.documentElement.textContent !== undefined) 
    ? function(elem) { // textContent Implementation here }
    : function(elem) { // innerText Implementation here }</description>
		<content:encoded><![CDATA[<p>If you checkout the YUI.dom implementation they go with this. Saves having to run checks each time the function is called.</p>
<p>var getText = (document.documentElement.textContent !== undefined)<br />
    ? function(elem) { // textContent Implementation here }<br />
    : function(elem) { // innerText Implementation here }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ktjrdn</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-4670</link>
		<dc:creator>ktjrdn</dc:creator>
		<pubDate>Wed, 27 Jan 2010 21:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-4670</guid>
		<description>I&#039;mlearning here, so don&#039;t laugh at me if this is a dumb question. But is there any reason you couldn&#039;t just do:

  var elem = document.getElementById(&#039;id&#039;);
  elem.textContent = value;
  elem.innerText = value;

Is there a need to explicitly check the browser support instead of just setting them both?</description>
		<content:encoded><![CDATA[<p>I&#8217;mlearning here, so don&#8217;t laugh at me if this is a dumb question. But is there any reason you couldn&#8217;t just do:</p>
<p>  var elem = document.getElementById(&#8217;id&#8217;);<br />
  elem.textContent = value;<br />
  elem.innerText = value;</p>
<p>Is there a need to explicitly check the browser support instead of just setting them both?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody Taylor</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-4087</link>
		<dc:creator>Cody Taylor</dc:creator>
		<pubDate>Wed, 29 Jul 2009 15:47:43 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-4087</guid>
		<description>@Dave Thanks for the tip. I updated the post accordingly.</description>
		<content:encoded><![CDATA[<p>@Dave Thanks for the tip. I updated the post accordingly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-4086</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 29 Jul 2009 15:10:59 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-4086</guid>
		<description>&quot;innerText&quot; has line breaks base on HTML semantics, but no &quot;textContent&quot;.

http://ccapeng.blogspot.com/2006/01/firefox-innertext.html</description>
		<content:encoded><![CDATA[<p>&#8220;innerText&#8221; has line breaks base on HTML semantics, but no &#8220;textContent&#8221;.</p>
<p><a href="http://ccapeng.blogspot.com/2006/01/firefox-innertext.html" rel="nofollow">http://ccapeng.blogspot.com/2006/01/firefox-innertext.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Davis</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-4082</link>
		<dc:creator>Jason Davis</dc:creator>
		<pubDate>Wed, 29 Jul 2009 01:49:47 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-4082</guid>
		<description>Of course, Mozilla also lets you do this:
&lt;pre&gt;
HTMLElement.prototype.__defineGetter__(&quot;innerText&quot;, function() {
    return this.textContent;
});
HTMLElement.prototype.__defineSetter__(&quot;innerText&quot;, function(val) {
    return this.textContent = val;
});
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Of course, Mozilla also lets you do this:<br />
<pre><pre>
HTMLElement.prototype.__defineGetter__(&quot;innerText&quot;, function() {
&nbsp;&nbsp;&nbsp;&nbsp;return this.textContent;
});
HTMLElement.prototype.__defineSetter__(&quot;innerText&quot;, function(val) {
&nbsp;&nbsp;&nbsp;&nbsp;return this.textContent = val;
});
</pre></pre></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-4078</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 28 Jul 2009 21:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-4078</guid>
		<description>That code won&#039;t work for IE8, it will return undefined for elements that have an empty string for their text. Instead, use this:

var message = elem.innerText &#124;&#124; elem.textContent &#124;&#124; &quot;&quot;;

or use jQuery.</description>
		<content:encoded><![CDATA[<p>That code won&#8217;t work for IE8, it will return undefined for elements that have an empty string for their text. Instead, use this:</p>
<p>var message = elem.innerText || elem.textContent || &#8220;&#8221;;</p>
<p>or use jQuery.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody Taylor</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-4077</link>
		<dc:creator>Cody Taylor</dc:creator>
		<pubDate>Tue, 28 Jul 2009 21:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-4077</guid>
		<description>Thanks for the heads up. Fixed the post. Glad to hear that FireFox is following the standards.</description>
		<content:encoded><![CDATA[<p>Thanks for the heads up. Fixed the post. Glad to hear that FireFox is following the standards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-4075</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 28 Jul 2009 21:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-4075</guid>
		<description>textContent is the standard, not innerText.  What DOM standard are you reading?

http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent

Regardless, still a problem that needs solving for cross-browser compatibility.</description>
		<content:encoded><![CDATA[<p>textContent is the standard, not innerText.  What DOM standard are you reading?</p>
<p><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent" rel="nofollow">http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent</a></p>
<p>Regardless, still a problem that needs solving for cross-browser compatibility.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody Taylor (codytaylor) 's status on Tuesday, 28-Jul-09 15:27:51 UTC - Identi.ca</title>
		<link>http://codytaylor.org/2009/07/javascript-innertext-and-textcontent.html/comment-page-1#comment-4074</link>
		<dc:creator>Cody Taylor (codytaylor) 's status on Tuesday, 28-Jul-09 15:27:51 UTC - Identi.ca</dc:creator>
		<pubDate>Tue, 28 Jul 2009 15:28:03 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14201#comment-4074</guid>
		<description>[...] JavaScript innerText and textContent http://codytaylor.org/?p=14201 [...]</description>
		<content:encoded><![CDATA[<p>[...] JavaScript innerText and textContent <a href="http://codytaylor.org/?p=14201" rel="nofollow">http://codytaylor.org/?p=14201</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

