<?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: The ultimate getElementsByClassName, anno 2008</title>
	<atom:link href="http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/</link>
	<description>Web development and Internet trends</description>
	<lastBuildDate>Fri, 19 Mar 2010 09:27:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-624841</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 01 Mar 2010 10:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-624841</guid>
		<description>Zu,

The function returns an an array. If you get multiple elements back, you need to loop over them; if you just want to change the first, write &lt;code&gt;getElementsByClassName(&quot;tab_13&quot;)[0].className=&quot;lighted&quot;;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Zu,</p>
<p>The function returns an an array. If you get multiple elements back, you need to loop over them; if you just want to change the first, write <code>getElementsByClassName("tab_13")[0].className="lighted";</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zu</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-624836</link>
		<dc:creator>Zu</dc:creator>
		<pubDate>Mon, 01 Mar 2010 10:24:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-624836</guid>
		<description>Hi!
I try to use this function in next way:
I have div with class tab_13
I type
&lt;code&gt;getElementsByClassName(&quot;tab_13&quot;).className=&quot;lighted&quot;;&lt;/code&gt;
but class doesn&#039;t change..
then when I type 
&lt;code&gt;alert (getElementsByClassName(&quot;tab_13&quot;));&lt;/code&gt;
I get &lt;cite&gt;[object HTMLDivElement]&lt;/cite&gt;
It seems that I go wrong somewhere... But where? :)
Thanks for the answers!</description>
		<content:encoded><![CDATA[<p>Hi!<br />
I try to use this function in next way:<br />
I have div with class tab_13<br />
I type<br />
<code>getElementsByClassName("tab_13").className="lighted";</code><br />
but class doesn&#8217;t change..<br />
then when I type<br />
<code>alert (getElementsByClassName("tab_13"));</code><br />
I get <cite>[object HTMLDivElement]</cite><br />
It seems that I go wrong somewhere&#8230; But where? <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thanks for the answers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-623668</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Tue, 23 Feb 2010 15:10:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-623668</guid>
		<description>Toan,

It works fine in IE. Please make sure to call it with &lt;code&gt;getElementsByClassName&lt;/code&gt;, i.e. not preceded by document.</description>
		<content:encoded><![CDATA[<p>Toan,</p>
<p>It works fine in IE. Please make sure to call it with <code>getElementsByClassName</code>, i.e. not preceded by document.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toan</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-623616</link>
		<dc:creator>Toan</dc:creator>
		<pubDate>Tue, 23 Feb 2010 09:45:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-623616</guid>
		<description>can you fix with IE  ?

thanks</description>
		<content:encoded><![CDATA[<p>can you fix with IE  ?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-616337</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Sat, 02 Jan 2010 19:48:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-616337</guid>
		<description>Pritush,

Yes, you could easily use &lt;code&gt;getElementsByClassName&lt;/code&gt; to do something like that. Also, if you use a JavaScript library, e.g. jQuery, there are a number of already existing tab plugins.</description>
		<content:encoded><![CDATA[<p>Pritush,</p>
<p>Yes, you could easily use <code>getElementsByClassName</code> to do something like that. Also, if you use a JavaScript library, e.g. jQuery, there are a number of already existing tab plugins.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pritush</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-615989</link>
		<dc:creator>Pritush</dc:creator>
		<pubDate>Wed, 30 Dec 2009 16:43:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-615989</guid>
		<description>i am using this for tabs , and need a bit help
here is the code i am using
&lt;code&gt;


tab1
tab1 content

 Click Here to go tab2 



tab2
tab2 contents
&lt;code&gt;

on clicking, &quot;Click Here to go tab2&quot; user can go to next tab, 
is it possible to make user go to another tab ( div id=&quot;2&quot; )editing onclick=&quot;click(this);&quot;</description>
		<content:encoded><![CDATA[<p>i am using this for tabs , and need a bit help<br />
here is the code i am using<br />
<code></p>
<p>tab1<br />
tab1 content</p>
<p> Click Here to go tab2 </p>
<p>tab2<br />
tab2 contents<br />
</code><code></p>
<p>on clicking, "Click Here to go tab2" user can go to next tab,<br />
is it possible to make user go to another tab ( div id="2" )editing onclick="click(this);"</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-615814</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Tue, 29 Dec 2009 19:21:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-615814</guid>
		<description>mighty_child,

You just call it with &lt;code&gt;getElementsByClassName(&quot;lastPostUser&quot;)&lt;/code&gt;, NOT having the word &lt;code&gt;document&lt;/code&gt; before it.</description>
		<content:encoded><![CDATA[<p>mighty_child,</p>
<p>You just call it with <code>getElementsByClassName("lastPostUser")</code>, NOT having the word <code>document</code> before it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mighty_child</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-615733</link>
		<dc:creator>mighty_child</dc:creator>
		<pubDate>Mon, 28 Dec 2009 16:07:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-615733</guid>
		<description>i wanna change lastPostUser
&lt;span class=&quot;lastPostUser&quot; ...

when i use
document.getElementsByClassName(&quot;lastPostUser&quot;).className = &quot;catLink&quot;;

it didnt work.. why? help me</description>
		<content:encoded><![CDATA[<p>i wanna change lastPostUser<br />
&lt;span class=&quot;lastPostUser&quot; &#8230;</p>
<p>when i use<br />
document.getElementsByClassName(&quot;lastPostUser&quot;).className = &quot;catLink&quot;;</p>
<p>it didnt work.. why? help me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sélectionner les éléments par leur classe avec getElementsByClassName &#187; Javascript &#38; Web Design - Tous les jours le meilleur des ressources Javascript pour intégrateurs web front-end (avec parfois un soupçon de PHP)</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-614340</link>
		<dc:creator>Sélectionner les éléments par leur classe avec getElementsByClassName &#187; Javascript &#38; Web Design - Tous les jours le meilleur des ressources Javascript pour intégrateurs web front-end (avec parfois un soupçon de PHP)</dc:creator>
		<pubDate>Wed, 16 Dec 2009 09:02:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-614340</guid>
		<description>[...] les éléments qui partagent une ou plusieurs classes. C&#8217;est là qu&#8217;intervient The Ultimate GetElementsByClassName déjà évoqué dans Utillisez le DOM et Javascript comme un chef pour redéfinir le comportement [...]</description>
		<content:encoded><![CDATA[<p>[...] les éléments qui partagent une ou plusieurs classes. C&#8217;est là qu&#8217;intervient The Ultimate GetElementsByClassName déjà évoqué dans Utillisez le DOM et Javascript comme un chef pour redéfinir le comportement [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-613571</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 09 Dec 2009 16:54:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-613571</guid>
		<description>Luis,

Glad it works for you!</description>
		<content:encoded><![CDATA[<p>Luis,</p>
<p>Glad it works for you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis Pabon</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-613559</link>
		<dc:creator>Luis Pabon</dc:creator>
		<pubDate>Wed, 09 Dec 2009 15:39:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-613559</guid>
		<description>Ahhh, Pat @ September 10th, 2009 at 3:39 had the key, the fix suggested works like a charm (prototype conflict) :)

Thanks !!!</description>
		<content:encoded><![CDATA[<p>Ahhh, Pat @ September 10th, 2009 at 3:39 had the key, the fix suggested works like a charm (prototype conflict) <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis Pabon</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-613558</link>
		<dc:creator>Luis Pabon</dc:creator>
		<pubDate>Wed, 09 Dec 2009 15:35:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-613558</guid>
		<description>Having some trouble with this and IE8.

The statement &quot;if (document.getElementsByClassName) {&quot; is true on IE8 but still, the function is not supported resulting on execution stopping sharp.

Am I missing something?</description>
		<content:encoded><![CDATA[<p>Having some trouble with this and IE8.</p>
<p>The statement &#8220;if (document.getElementsByClassName) {&#8221; is true on IE8 but still, the function is not supported resulting on execution stopping sharp.</p>
<p>Am I missing something?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Le code CSS et Javascript inline saimal--css 4 design</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-613402</link>
		<dc:creator>Le code CSS et Javascript inline saimal--css 4 design</dc:creator>
		<pubDate>Tue, 08 Dec 2009 05:24:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-613402</guid>
		<description>[...] dans les navigateurs. Pour y remédier, je recommande l&#8217;utilisation de la fonction getElementsByClassName qui contient par ailleurs quelques fonctionnalités [...]</description>
		<content:encoded><![CDATA[<p>[...] dans les navigateurs. Pour y remédier, je recommande l&#8217;utilisation de la fonction getElementsByClassName qui contient par ailleurs quelques fonctionnalités [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JavaScript Toolkit &#8211; Nov 2009&#160;&#124;&#160;dConstructing - JavaScript</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-610469</link>
		<dc:creator>JavaScript Toolkit &#8211; Nov 2009&#160;&#124;&#160;dConstructing - JavaScript</dc:creator>
		<pubDate>Mon, 16 Nov 2009 22:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-610469</guid>
		<description>[...] the their class names instead. Please read the creator&#8217;s page for proper usage instructions. Original Source &#8211; check for terms of [...]</description>
		<content:encoded><![CDATA[<p>[...] the their class names instead. Please read the creator&#8217;s page for proper usage instructions. Original Source &#8211; check for terms of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-604451</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 05 Oct 2009 19:27:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-604451</guid>
		<description>Fredrik,

It&#039;s a valid question, but generally I see this as a fast stand-alone and consistent &lt;code&gt;getElementsByClassName&lt;/code&gt; across web browsers.

For more advanced usage I&#039;d probably recommend a selector engine as well.</description>
		<content:encoded><![CDATA[<p>Fredrik,</p>
<p>It&#8217;s a valid question, but generally I see this as a fast stand-alone and consistent <code>getElementsByClassName</code> across web browsers.</p>
<p>For more advanced usage I&#8217;d probably recommend a selector engine as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fredrik</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-604441</link>
		<dc:creator>Fredrik</dc:creator>
		<pubDate>Mon, 05 Oct 2009 16:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-604441</guid>
		<description>ok, thanks. 
Not sure if you rate this snippet as a library component? In that case if would be nice to automatically add the &#039;*&#039;-&gt;null conversion.
--
Currently tag name is obviously optional, but personally I quite often need both tag- and class-name in various combinations. That pattern is present in MochiKit as getElementsByTagAndClassName() http://mochikit.com/doc/html/MochiKit/DOM.html#fn-getelementsbytagandclassname
Difference with youe code (apart from speed :) ) is that is is symmetric with regards to tag or class being null/optional. (i.e it has an explicit getElementsByTagName path).
Perhaps that would be a case worth exploring performance profiles for also?

(yes, I guess I should rather use a proper selector engine..)</description>
		<content:encoded><![CDATA[<p>ok, thanks.<br />
Not sure if you rate this snippet as a library component? In that case if would be nice to automatically add the &#8216;*&#8217;-&gt;null conversion.<br />
&#8211;<br />
Currently tag name is obviously optional, but personally I quite often need both tag- and class-name in various combinations. That pattern is present in MochiKit as getElementsByTagAndClassName() <a href="http://mochikit.com/doc/html/MochiKit/DOM.html#fn-getelementsbytagandclassname" rel="nofollow">http://mochikit.com/doc/html/MochiKit/DOM.html#fn-getelementsbytagandclassname</a><br />
Difference with youe code (apart from speed <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) is that is is symmetric with regards to tag or class being null/optional. (i.e it has an explicit getElementsByTagName path).<br />
Perhaps that would be a case worth exploring performance profiles for also?</p>
<p>(yes, I guess I should rather use a proper selector engine..)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-604437</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 05 Oct 2009 14:28:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-604437</guid>
		<description>Fredrik,

Yes, some browsers could complain on that, and the recommended way is to send in an empty string, &lt;code&gt;null&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>Fredrik,</p>
<p>Yes, some browsers could complain on that, and the recommended way is to send in an empty string, <code>null</code> or <code>false</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fredrik</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-604426</link>
		<dc:creator>Fredrik</dc:creator>
		<pubDate>Mon, 05 Oct 2009 13:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-604426</guid>
		<description>Hi,
I think there&#039;s something wrong with the native fast path (first block)?.
First, all other paths do a &lt;code&gt;tag = tag &#124;&#124; &quot;*&quot;;&lt;/code&gt; initially and also, if actually passing a &#039;*&#039; as tag Firefox 3.5 complains about invalid regexp (&quot;*\b&quot;). Should it use empty string instead of &#039;*&#039;?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I think there&#8217;s something wrong with the native fast path (first block)?.<br />
First, all other paths do a <code>tag = tag || "*";</code> initially and also, if actually passing a &#8216;*&#8217; as tag Firefox 3.5 complains about invalid regexp (&#8220;*\b&#8221;). Should it use empty string instead of &#8216;*&#8217;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WHATWG?The Road to HTML 5: getElementsByClassName() &#171; HTML5.JP ???</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-603067</link>
		<dc:creator>WHATWG?The Road to HTML 5: getElementsByClassName() &#171; HTML5.JP ???</dc:creator>
		<pubDate>Fri, 25 Sep 2009 07:50:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-603067</guid>
		<description>[...] getElementsByClassName() ??Firefox 3, Opera 9.5, Safari 3.1, Google Chrome ?????????????????????IE ???????????????getElementsByClassName() ?????????????????????????????????????????????Robert Nyman ????????????????????????????????? getElementsByClassName ??????????????????????? [...]</description>
		<content:encoded><![CDATA[<p>[...] getElementsByClassName() ??Firefox 3, Opera 9.5, Safari 3.1, Google Chrome ?????????????????????IE ???????????????getElementsByClassName() ?????????????????????????????????????????????Robert Nyman ????????????????????????????????? getElementsByClassName ??????????????????????? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: One million downloads for getElementsByClassName - Robert's talk</title>
		<link>http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-602369</link>
		<dc:creator>One million downloads for getElementsByClassName - Robert's talk</dc:creator>
		<pubDate>Tue, 22 Sep 2009 08:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/#comment-602369</guid>
		<description>[...] hadn&#8217;t checked the statistics for some time for my getElementsByClassName code, so you can just guess my surprise when I saw it has passed one million [...]</description>
		<content:encoded><![CDATA[<p>[...] hadn&#8217;t checked the statistics for some time for my getElementsByClassName code, so you can just guess my surprise when I saw it has passed one million [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
