<?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: Do not use the style property on HTML objects</title>
	<atom:link href="http://www.javascriptkata.com/2007/04/03/do-not-use-the-style-property-on-html-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javascriptkata.com/2007/04/03/do-not-use-the-style-property-on-html-objects/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=do-not-use-the-style-property-on-html-objects</link>
	<description>helping you with javascript since 2007</description>
	<lastBuildDate>Tue, 31 Jan 2012 11:22:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: picks on sports</title>
		<link>http://www.javascriptkata.com/2007/04/03/do-not-use-the-style-property-on-html-objects/comment-page-1/#comment-1405</link>
		<dc:creator>picks on sports</dc:creator>
		<pubDate>Thu, 13 Oct 2011 12:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=20#comment-1405</guid>
		<description>&lt;strong&gt;2011...&lt;/strong&gt;

Way cool, some valid points! I appreciate you making this article available, the rest of the site is also high quality. Have a fun....</description>
		<content:encoded><![CDATA[<p><strong>2011&#8230;</strong></p>
<p>Way cool, some valid points! I appreciate you making this article available, the rest of the site is also high quality. Have a fun&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dYcbbgcx</title>
		<link>http://www.javascriptkata.com/2007/04/03/do-not-use-the-style-property-on-html-objects/comment-page-1/#comment-1350</link>
		<dc:creator>dYcbbgcx</dc:creator>
		<pubDate>Wed, 12 Oct 2011 20:58:40 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=20#comment-1350</guid>
		<description>&lt;strong&gt;2011...&lt;/strong&gt;

It’s really a nice and helpful piece of info. I am glad that you shared this helpful information with us. Please keep us informed like this. Thank you for sharing....</description>
		<content:encoded><![CDATA[<p><strong>2011&#8230;</strong></p>
<p>It’s really a nice and helpful piece of info. I am glad that you shared this helpful information with us. Please keep us informed like this. Thank you for sharing&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dYcxcgcvfgg</title>
		<link>http://www.javascriptkata.com/2007/04/03/do-not-use-the-style-property-on-html-objects/comment-page-1/#comment-1324</link>
		<dc:creator>dYcxcgcvfgg</dc:creator>
		<pubDate>Sun, 09 Oct 2011 03:50:21 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=20#comment-1324</guid>
		<description>&lt;strong&gt;2011...&lt;/strong&gt;

I was recommended this website by my cousin. I&#039;m not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are amazing! Thanks!...</description>
		<content:encoded><![CDATA[<p><strong>2011&#8230;</strong></p>
<p>I was recommended this website by my cousin. I&#8217;m not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are amazing! Thanks!&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dYcxcgcvf</title>
		<link>http://www.javascriptkata.com/2007/04/03/do-not-use-the-style-property-on-html-objects/comment-page-1/#comment-1287</link>
		<dc:creator>dYcxcgcvf</dc:creator>
		<pubDate>Sat, 08 Oct 2011 02:16:55 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=20#comment-1287</guid>
		<description>&lt;strong&gt;2011...&lt;/strong&gt;

I just couldn&#039;t depart your website before suggesting that I extremely enjoyed the standard info a person provide for your visitors? Is going to be back often in order to check up on new posts...</description>
		<content:encoded><![CDATA[<p><strong>2011&#8230;</strong></p>
<p>I just couldn&#8217;t depart your website before suggesting that I extremely enjoyed the standard info a person provide for your visitors? Is going to be back often in order to check up on new posts&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wixa! &#187; Blog Archive &#187; Annoying Javascript/CSS &#8220;Feature&#8221; Of the Day...A product of Jason E. Rist</title>
		<link>http://www.javascriptkata.com/2007/04/03/do-not-use-the-style-property-on-html-objects/comment-page-1/#comment-61</link>
		<dc:creator>wixa! &#187; Blog Archive &#187; Annoying Javascript/CSS &#8220;Feature&#8221; Of the Day...A product of Jason E. Rist</dc:creator>
		<pubDate>Tue, 10 Apr 2007 18:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=20#comment-61</guid>
		<description>[...] clause when you set the backgroundColor in the CSS. For some reason the !important CSS call cannot be overridden by Javascript style change. I ended up solving it by defining a different class in the CSS and then switching it via [...]</description>
		<content:encoded><![CDATA[<p>[...] clause when you set the backgroundColor in the CSS. For some reason the !important CSS call cannot be overridden by Javascript style change. I ended up solving it by defining a different class in the CSS and then switching it via [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Francis</title>
		<link>http://www.javascriptkata.com/2007/04/03/do-not-use-the-style-property-on-html-objects/comment-page-1/#comment-60</link>
		<dc:creator>Craig Francis</dc:creator>
		<pubDate>Fri, 06 Apr 2007 22:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=20#comment-60</guid>
		<description>I haven&#039;t had a chance to write it up yet, but there is a handy little function called &#039;cssjs&#039; that I think &#039;Christian Heilmann&#039; (icant.co.uk) wrote:

--------------------------

  function cssjs(action, object, className) {

    if (action == &#039;add&#039;) {

      if (!cssjs(&#039;check&#039;, object, className)) {
        object.className += (object.className == &#039;&#039; ? &#039;&#039; : &#039; &#039;) + className;
      }

    } else if (action == &#039;remove&#039;) {

      var exp = new RegExp(&#039;(^&#039; + className + &#039;( &#124;$)&#124; &#039; + className + &#039;\\b)&#039;);
      object.className = object.className.replace(exp, &#039;&#039;);

    } else if (action == &#039;check&#039;) {

      var exp = new RegExp(&#039;\\b&#039; + className + &#039;\\b&#039;);
      return exp.test(object.className);

    }

    return true;

  }

--------------------------

http://www.onlinetools.org/articles/unobtrusivejavascript/cssjsseparation.html

NOTE: I have slightly edited the code as I did not need the &#039;swap&#039; feature, and also it needed some cleanup when it came to running in Firefox with Strict JavaScript error reporting enabled.

Anyway, it provides a simple interface for adding, removing or checking for the presence of class names.

This gets around the problem of setting the &#039;.className&#039; and over-riding the class values from other scripts running on the website.

As another little tip... try to prefix your class names with &#039;js&#039;, so you can identify your JavaScript styles.

For example, something I quite regularly do is add a &#039;jsEnabled&#039; class to the parent  of the elements that the JavaScript is working on.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t had a chance to write it up yet, but there is a handy little function called &#8216;cssjs&#8217; that I think &#8216;Christian Heilmann&#8217; (icant.co.uk) wrote:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>  function cssjs(action, object, className) {</p>
<p>    if (action == &#8216;add&#8217;) {</p>
<p>      if (!cssjs(&#8216;check&#8217;, object, className)) {<br />
        object.className += (object.className == &#8221; ? &#8221; : &#8216; &#8216;) + className;<br />
      }</p>
<p>    } else if (action == &#8216;remove&#8217;) {</p>
<p>      var exp = new RegExp(&#8216;(^&#8217; + className + &#8216;( |$)| &#8216; + className + &#8216;\\b)&#8217;);<br />
      object.className = object.className.replace(exp, &#8221;);</p>
<p>    } else if (action == &#8216;check&#8217;) {</p>
<p>      var exp = new RegExp(&#8216;\\b&#8217; + className + &#8216;\\b&#8217;);<br />
      return exp.test(object.className);</p>
<p>    }</p>
<p>    return true;</p>
<p>  }</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><a href="http://www.onlinetools.org/articles/unobtrusivejavascript/cssjsseparation.html" rel="nofollow">http://www.onlinetools.org/articles/unobtrusivejavascript/cssjsseparation.html</a></p>
<p>NOTE: I have slightly edited the code as I did not need the &#8216;swap&#8217; feature, and also it needed some cleanup when it came to running in Firefox with Strict JavaScript error reporting enabled.</p>
<p>Anyway, it provides a simple interface for adding, removing or checking for the presence of class names.</p>
<p>This gets around the problem of setting the &#8216;.className&#8217; and over-riding the class values from other scripts running on the website.</p>
<p>As another little tip&#8230; try to prefix your class names with &#8216;js&#8217;, so you can identify your JavaScript styles.</p>
<p>For example, something I quite regularly do is add a &#8216;jsEnabled&#8217; class to the parent  of the elements that the JavaScript is working on.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

