<?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"
	>
<channel>
	<title>Comments on: The Ultimate getElementsByClassName</title>
	<atom:link href="http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/</link>
	<description>Web development and Internet trends</description>
	<pubDate>Thu, 20 Nov 2008 00:15:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Fun&#231;&#227;o getElementsByClassName - Vers&#227;o 2008 &#187; Pinceladas da Web - Reflex&#245;es sobre XHTML, CSS, PHP e WebStandards</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-370878</link>
		<dc:creator>Fun&#231;&#227;o getElementsByClassName - Vers&#227;o 2008 &#187; Pinceladas da Web - Reflex&#245;es sobre XHTML, CSS, PHP e WebStandards</dc:creator>
		<pubDate>Tue, 12 Aug 2008 09:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-370878</guid>
		<description>[...] Nyman, no ano de 2005, publicou em seu blog um artigo entitulado &#8220;The Ultimate getElementsByClassName&#8220;, uma fun&#231;&#227;o desenvolvida em JavaScript, que sem a utiliza&#231;&#227;o de [...]</description>
		<content:encoded><![CDATA[<p>[...] Nyman, no ano de 2005, publicou em seu blog um artigo entitulado &#8220;The Ultimate getElementsByClassName&#8220;, uma fun&ccedil;&atilde;o desenvolvida em JavaScript, que sem a utiliza&ccedil;&atilde;o de [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simo</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-352752</link>
		<dc:creator>Simo</dc:creator>
		<pubDate>Fri, 25 Jul 2008 15:54:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-352752</guid>
		<description>The ultimate solution is to use mootools =) it's offer a similar solution =)</description>
		<content:encoded><![CDATA[<p>The ultimate solution is to use mootools =) it&#8217;s offer a similar solution =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: getElementsByClassName versión 2008 &#124; aNieto2K</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-327827</link>
		<dc:creator>getElementsByClassName versión 2008 &#124; aNieto2K</dc:creator>
		<pubDate>Fri, 04 Jul 2008 15:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-327827</guid>
		<description>[...] Robert Nyman publicó en 2005 un artículo en el que mostraba la &#8220;Ultimate getElementsByClassName&#8220;, una función desarrollada en Javascript que sin necesidad de usar ningún tipo de framework nos permite obtener todos los elementos de una misma clase pasada por parámetro. [...]</description>
		<content:encoded><![CDATA[<p>[...] Robert Nyman publicó en 2005 un artículo en el que mostraba la &#8220;Ultimate getElementsByClassName&#8220;, una función desarrollada en Javascript que sin necesidad de usar ningún tipo de framework nos permite obtener todos los elementos de una misma clase pasada por parámetro. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ASP.NET AJAX: Creating Reusable JavaScript Components (that are not Controls) @ ZDima.net</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-303607</link>
		<dc:creator>ASP.NET AJAX: Creating Reusable JavaScript Components (that are not Controls) @ ZDima.net</dc:creator>
		<pubDate>Sun, 15 Jun 2008 00:48:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-303607</guid>
		<description>[...] to them. To fetch these elements I am using a helper function called getElementsByClassName (taken from here) that scans the panel to find all of the elements that have this maintain-scroll class applied to [...]</description>
		<content:encoded><![CDATA[<p>[...] to them. To fetch these elements I am using a helper function called getElementsByClassName (taken from here) that scans the panel to find all of the elements that have this maintain-scroll class applied to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rewriting the TextBoxWatermarkExtender as an ASP.NET AJAX Plugin @ ZDima.net</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-303595</link>
		<dc:creator>Rewriting the TextBoxWatermarkExtender as an ASP.NET AJAX Plugin @ ZDima.net</dc:creator>
		<pubDate>Sun, 15 Jun 2008 00:37:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-303595</guid>
		<description>[...] based Component So I implemented a very simple Sys.Component JavaScript object that uses the getElementsByClassName function to pull out all of the input elements with the watermark CSS class applied to them. The [...]</description>
		<content:encoded><![CDATA[<p>[...] based Component So I implemented a very simple Sys.Component JavaScript object that uses the getElementsByClassName function to pull out all of the input elements with the watermark <acronym title="Cascading Style Sheets">CSS</acronym> class applied to them. The [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The ultimate getElementsByClassName, anno 2008 - Robert&#8217;s talk - Web development and Internet trends</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-285189</link>
		<dc:creator>The ultimate getElementsByClassName, anno 2008 - Robert&#8217;s talk - Web development and Internet trends</dc:creator>
		<pubDate>Tue, 27 May 2008 14:41:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-285189</guid>
		<description>[...] and a half years ago, I released the first version of getElementsByClassName. With how web browsers has evolved since, I thought I&#8217;d release a real ultimate version, [...]</description>
		<content:encoded><![CDATA[<p>[...] and a half years ago, I released the first version of getElementsByClassName. With how web browsers has evolved since, I thought I&#8217;d release a real ultimate version, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-284488</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 26 May 2008 23:03:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-284488</guid>
		<description>website design,

Glad you like it!

Seb,

Ah, it was due to trying to prevent some WordPress escaping. The code in the post is ok now too.</description>
		<content:encoded><![CDATA[<p>website design,</p>
<p>Glad you like it!</p>
<p>Seb,</p>
<p>Ah, it was due to trying to prevent some WordPress escaping. The code in the post is ok now too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seb</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-284474</link>
		<dc:creator>Seb</dc:creator>
		<pubDate>Mon, 26 May 2008 22:42:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-284474</guid>
		<description>I couldn't get this working at first - turns out the code you have on this page has superfluos slashes in the regular expression.  Copied and pasted from the JS file instead and that version was fine.</description>
		<content:encoded><![CDATA[<p>I couldn&#8217;t get this working at first - turns out the code you have on this page has superfluos slashes in the regular expression.  Copied and pasted from the JS file instead and that version was fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: website design</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-265353</link>
		<dc:creator>website design</dc:creator>
		<pubDate>Mon, 05 May 2008 11:34:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-265353</guid>
		<description>Very good and usefull,  thanks</description>
		<content:encoded><![CDATA[<p>Very good and usefull,  thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: getElementsByClassName - Javascript &#171; edusanver - Blog de Eduardo Sanchez Vera</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-258884</link>
		<dc:creator>getElementsByClassName - Javascript &#171; edusanver - Blog de Eduardo Sanchez Vera</dc:creator>
		<pubDate>Sun, 27 Apr 2008 11:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-258884</guid>
		<description>[...] The Ultimate getElementsByClassName http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsby... [...]</description>
		<content:encoded><![CDATA[<p>[...] The Ultimate getElementsByClassName <a href="http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsby.." rel="nofollow">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsby..</a>. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cristiano on Tech/Life &#187; My Bookmarks For March 28th - April 13th</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-248597</link>
		<dc:creator>Cristiano on Tech/Life &#187; My Bookmarks For March 28th - April 13th</dc:creator>
		<pubDate>Sun, 13 Apr 2008 13:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-248597</guid>
		<description>[...] The Ultimate getElementsByClassName - A simple JS function to get elements by classname. Needed it to get my bookmarklet to work. [...]</description>
		<content:encoded><![CDATA[<p>[...] The Ultimate getElementsByClassName - A simple JS function to get elements by classname. Needed it to get my bookmarklet to work. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JJ May &#187; Blog Archive &#187; Javascript Timepicker</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-247121</link>
		<dc:creator>JJ May &#187; Blog Archive &#187; Javascript Timepicker</dc:creator>
		<pubDate>Fri, 11 Apr 2008 08:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-247121</guid>
		<description>[...] as well. I would keep it in your arsenal if I were you. Furthermore, I am also borrowing the getElementsByClassName script from Robert Nyman. This will allow us to apply our javascript dynamically to our clock [...]</description>
		<content:encoded><![CDATA[<p>[...] as well. I would keep it in your arsenal if I were you. Furthermore, I am also borrowing the getElementsByClassName script from Robert Nyman. This will allow us to apply our javascript dynamically to our clock [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cristiano on Tech/Life &#187; The &#8220;Vimeo Flickr Set Photos for Vimeo&#8221; Bookmarklet</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-244550</link>
		<dc:creator>Cristiano on Tech/Life &#187; The &#8220;Vimeo Flickr Set Photos for Vimeo&#8221; Bookmarklet</dc:creator>
		<pubDate>Mon, 07 Apr 2008 14:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-244550</guid>
		<description>[...] make this bookmarklet I used some code from this site, and this little tool helped me out to compress the code.   Posted inProjects, SoftwareApril 7th, [...]</description>
		<content:encoded><![CDATA[<p>[...] make this bookmarklet I used some code from this site, and this little tool helped me out to compress the code.   Posted inProjects, SoftwareApril 7th, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JavaScript getElementsByClassName &#124; NerdStarGamer</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-224578</link>
		<dc:creator>JavaScript getElementsByClassName &#124; NerdStarGamer</dc:creator>
		<pubDate>Thu, 06 Mar 2008 02:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-224578</guid>
		<description>[...] I was able to quickly find Robert Nyman&#8217;s elegant getElementsByClassName function in The Ultimate GetElementsByClassName. [...]</description>
		<content:encoded><![CDATA[<p>[...] I was able to quickly find Robert Nyman&#8217;s elegant getElementsByClassName function in The Ultimate GetElementsByClassName. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: getElementsByClassName &#8250; Neatly Sliced</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-209400</link>
		<dc:creator>getElementsByClassName &#8250; Neatly Sliced</dc:creator>
		<pubDate>Thu, 14 Feb 2008 04:16:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-209400</guid>
		<description>[...] Usually JavaScript libraries include a getElementsByClassName function. However, if you&#8217;re building your own personal library, you may want to include your own version. Robert Nyman has built and amended over the past 2.5 years a function for this very method: The Ultimate getElementsByClassName! [...]</description>
		<content:encoded><![CDATA[<p>[...] Usually JavaScript libraries include a getElementsByClassName function. However, if you&#8217;re building your own personal library, you may want to include your own version. Robert Nyman has built and amended over the past 2.5 years a function for this very method: The Ultimate getElementsByClassName! [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Integrando la b?squeda en las entradas @ otro blog m</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-201897</link>
		<dc:creator>Integrando la b?squeda en las entradas @ otro blog m</dc:creator>
		<pubDate>Mon, 04 Feb 2008 14:18:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-201897</guid>
		<description>[...] un JavaScript busca todos esos spans (el c?digo para seleccionar los spans de una cierta clase ni siquiera es m?o) y le a?ade el punteado, la mosca y el enlace. Con la gracia que si dese?ramos cambiar de buscador, [...]</description>
		<content:encoded><![CDATA[<p>[...] un JavaScript busca todos esos spans (el c?digo para seleccionar los spans de una cierta clase ni siquiera es m?o) y le a?ade el punteado, la mosca y el enlace. Con la gracia que si dese?ramos cambiar de buscador, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-190853</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Tue, 22 Jan 2008 09:13:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-190853</guid>
		<description>Jovica,

I have no information about performance, but it seems a bit superfluous to add the method to every element in the web page. When it comes to calling the method on an element itself, though, I agree that it is a nicer approach.

My suggestion is to only add the method to elements that need it, and it's the base approach of my &lt;a href="http://www.robertnyman.com/domassistant/" rel="nofollow"&gt;DOMAssistant library&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Jovica,</p>
<p>I have no information about performance, but it seems a bit superfluous to add the method to every element in the web page. When it comes to calling the method on an element itself, though, I agree that it is a nicer approach.</p>
<p>My suggestion is to only add the method to elements that need it, and it&#8217;s the base approach of my <a href="http://www.robertnyman.com/domassistant/" rel="nofollow">DOMAssistant library</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jovica Aleksik</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-190547</link>
		<dc:creator>Jovica Aleksik</dc:creator>
		<pubDate>Mon, 21 Jan 2008 19:41:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-190547</guid>
		<description>Shame on me, didn't even look at previous comments...and missed object-prototype version above :( :D Quite similar, though I allowed for space-separated, multiple classnames in addition.
Heh.. :)
So what about performance issues - no matter at all?
Possible/hypothetical differences between object and Node prototype?</description>
		<content:encoded><![CDATA[<p>Shame on me, didn&#8217;t even look at previous comments&#8230;and missed object-prototype version above <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> Quite similar, though I allowed for space-separated, multiple classnames in addition.<br />
Heh.. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
So what about performance issues - no matter at all?<br />
Possible/hypothetical differences between object and Node prototype?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jovica Aleksik</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-190546</link>
		<dc:creator>Jovica Aleksik</dc:creator>
		<pubDate>Mon, 21 Jan 2008 19:37:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-190546</guid>
		<description>Hi.
I didn't like the way this function had to be called, I found it too un-intuitive. Mostly when I need a function like this, I need it short and simple. Also, I didn't like to pass an object to the function for all the classes I needed - too complicated, I wanted to have it as flexible as in html's class="" itself.

Now I don't know whether it is bad for the overall performance when you add functions to the Node prototype itself, but that's what I just did: Now you can call the function on any node to get elements of given classnames inside of it. Of course you can use it on the document node itself too, to get all matching elements in the whole documnt.
Maybe this is a good place to get some profound answers to the performance question - Does one have to be careful with Node-prototype-functions regarding the performance of the site/document?? 
However, here are some examples of how to call the version changed by me:
&lt;code&gt;
   var e = document.getElementsByClassName('green')[0];
   var form = document.getElementsByClassName('floating login box', 'form');
   var form = document.getElementsByClassName('login box floating', 'form');
   /* if you need only elements within a specific element: */
   var container = document.getElementById('container');
   var boxes = container.getElementsByClassName('box');
   /* handy: */
   var boxes = $('container').getElementsByClassName('box');
&lt;/code&gt;

So here is the changed version:

&lt;code&gt;Node.prototype.getElementsByClassName = function () {
  /*
  	Written by Jonathan Snook, http://www.snook.ca/jonathan
  	Add-ons by Robert Nyman, http://www.robertnyman.com
  	and Jovica Aleksik, loopmode@loopmode.de
  	arguments: className, [tagName]
  */
  if (this.nodeType != 9) {
    return;
  }
  var oElm = this;
  var oClassNames = arguments[0].indexOf(' ') != -1 ? arguments[0].split(' ') : arguments[0];
  var strTagName = arguments[1] ? arguments[1] : '*';
  
	var arrElements = (strTagName == "*" &#38;&#38; oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var arrRegExpClassNames = new Array();
	
  if(typeof oClassNames == "object"){
		for(var i=0; i&#60;oClassNames.length; i++){
			arrRegExpClassNames.push(new RegExp("(^&#124;\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s&#124;$)"));
		}
	}
	else{
		arrRegExpClassNames.push(new RegExp("(^&#124;\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s&#124;$)"));
	}
	var oElement;
	var bMatchesAll;
	for(var j=0; j&#60;arrElements.length; j++){
		oElement = arrElements[j];
		bMatchesAll = true;
		for(var k=0; k&#60;arrRegExpClassNames.length; k++){
			if(!arrRegExpClassNames[k].test(oElement.className)){
				bMatchesAll = false;
				break;
			}
		}
		if(bMatchesAll){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
};
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi.<br />
I didn&#8217;t like the way this function had to be called, I found it too un-intuitive. Mostly when I need a function like this, I need it short and simple. Also, I didn&#8217;t like to pass an object to the function for all the classes I needed - too complicated, I wanted to have it as flexible as in <acronym title="HyperText Markup Language">HTML</acronym>&#8217;s class=&#8221;" itself.</p>
<p>Now I don&#8217;t know whether it is bad for the overall performance when you add functions to the Node prototype itself, but that&#8217;s what I just did: Now you can call the function on any node to get elements of given classnames inside of it. Of course you can use it on the document node itself too, to get all matching elements in the whole documnt.<br />
Maybe this is a good place to get some profound answers to the performance question - Does one have to be careful with Node-prototype-functions regarding the performance of the site/document??<br />
However, here are some examples of how to call the version changed by me:<br />
<code><br />
   var e = document.getElementsByClassName('green')[0];<br />
   var form = document.getElementsByClassName(&#8217;floating login box&#8217;, &#8216;form&#8217;);<br />
   var form = document.getElementsByClassName(&#8217;login box floating&#8217;, &#8216;form&#8217;);<br />
   /* if you need only elements within a specific element: */<br />
   var container = document.getElementById(&#8217;container&#8217;);<br />
   var boxes = container.getElementsByClassName(&#8217;box&#8217;);<br />
   /* handy: */<br />
   var boxes = $(&#8217;container&#8217;).getElementsByClassName(&#8217;box&#8217;);<br />
</code></p>
<p>So here is the changed version:</p>
<p><code>Node.prototype.getElementsByClassName = function () {<br />
  /*<br />
  	Written by Jonathan Snook, <a href="http://www.snook.ca/jonathan" rel="nofollow">http://www.snook.ca/jonathan</a><br />
  	Add-ons by Robert Nyman, <a href="http://www.robertnyman.com" rel="nofollow">http://www.robertnyman.com</a><br />
  	and Jovica Aleksik, <a href="mailto:loopmode@loopmode.de">loopmode@loopmode.de</a><br />
  	arguments: className, [tagName]<br />
  */<br />
  if (this.nodeType != 9) {<br />
    return;<br />
  }<br />
  var oElm = this;<br />
  var oClassNames = arguments[0].indexOf(&#8217; &#8216;) != -1 ? arguments[0].split(&#8217; &#8216;) : arguments[0];<br />
  var strTagName = arguments[1] ? arguments[1] : &#8216;*&#8217;;</p>
<p>	var arrElements = (strTagName == &#8220;*&#8221; &amp;&amp; oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);<br />
	var arrReturnElements = new Array();<br />
	var arrRegExpClassNames = new Array();</p>
<p>  if(typeof oClassNames == &#8220;object&#8221;){<br />
		for(var i=0; i&lt;oClassNames.length; i++){<br />
			arrRegExpClassNames.push(new RegExp(&#8221;(^|\\s)&#8221; + oClassNames[i].replace(/\-/g, &#8220;\\-&#8221;) + &#8220;(\\s|$)&#8221;));<br />
		}<br />
	}<br />
	else{<br />
		arrRegExpClassNames.push(new RegExp(&#8221;(^|\\s)&#8221; + oClassNames.replace(/\-/g, &#8220;\\-&#8221;) + &#8220;(\\s|$)&#8221;));<br />
	}<br />
	var oElement;<br />
	var bMatchesAll;<br />
	for(var j=0; j&lt;arrElements.length; j++){<br />
		oElement = arrElements[j];<br />
		bMatchesAll = true;<br />
		for(var k=0; k&lt;arrRegExpClassNames.length; k++){<br />
			if(!arrRegExpClassNames[k].test(oElement.className)){<br />
				bMatchesAll = false;<br />
				break;<br />
			}<br />
		}<br />
		if(bMatchesAll){<br />
			arrReturnElements.push(oElement);<br />
		}<br />
	}<br />
	return (arrReturnElements)<br />
};<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Emotional Pumpkin &#187; IE7 lessons learned</title>
		<link>http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-182867</link>
		<dc:creator>The Emotional Pumpkin &#187; IE7 lessons learned</dc:creator>
		<pubDate>Sat, 12 Jan 2008 01:18:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/#comment-182867</guid>
		<description>[...] that the above JS code depends on Robert Nyman&#8217;s ultimate getElementsByClassName implementation and the Prototype JavaScript framework.       filed in Internet/technology () tagged with ie7, [...]</description>
		<content:encoded><![CDATA[<p>[...] that the above JS code depends on Robert Nyman&#8217;s ultimate getElementsByClassName implementation and the Prototype JavaScript framework.       filed in Internet/technology () tagged with ie7, [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
