<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'addClass, removeClass, hasClass'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Mon, 06 Apr 2026 11:52:35 +0000</lastBuildDate>
    <item>
      <title>Kerrick said on 14/Jan/2011</title>
      <link>https://snipplr.com/view/3561/addclass-removeclass-hasclass</link>
      <description>&lt;p&gt;I recommend adding this line to the end of `addClass()`&#13;
&#13;
    ele.className.replace(/ +/g,' ');&#13;
&#13;
And changing this line of `removeClass()`&#13;
&#13;
    ele.className=ele.className.replace(reg,' ');&#13;
&#13;
to this:&#13;
&#13;
    ele.className=ele.className.replace(reg,'');&#13;
&#13;
Doing so will remove all the extraneous spaces.&lt;/p&gt;</description>
      <pubDate>Fri, 14 Jan 2011 19:14:07 UTC</pubDate>
      <guid>https://snipplr.com/view/3561/addclass-removeclass-hasclass</guid>
    </item>
  </channel>
</rss>
