<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SEOAnalytic.com official blog &#187; apply change</title>
	<atom:link href="http://seoanalytic.com/blog/tag/apply-change/feed/" rel="self" type="application/rss+xml" />
	<link>http://seoanalytic.com/blog</link>
	<description>My thoughts about SEO, programming and life maybe ;)</description>
	<lastBuildDate>Mon, 20 Apr 2009 05:41:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to apply change to all TDs within a TR (columns withing a row)</title>
		<link>http://seoanalytic.com/blog/38/how-to-apply-change-to-all-tds-within-a-tr-columns-withing-a-row/</link>
		<comments>http://seoanalytic.com/blog/38/how-to-apply-change-to-all-tds-within-a-tr-columns-withing-a-row/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 18:10:32 +0000</pubDate>
		<dc:creator>Dragos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[apply change]]></category>
		<category><![CDATA[column withing row]]></category>

		<guid isPermaLink="false">http://seoanalytic.com/blog/?p=38</guid>
		<description><![CDATA[I wanted to change the background color for a row with document.getElementById(row_id).style.backgroundColor=&#8217;red&#8217; but unfortunately that doesnt work for some reason. Then i thought this could be done by applying the same style to all of the columns within a row (all TDs withing a TR). I&#8217;ve searched the web for such a function but i [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to change the background color for a row with document.getElementById(row_id).style.backgroundColor=&#8217;red&#8217; but unfortunately that doesnt work for some reason. Then i thought this could be done by applying the same style to all of the columns within a row (all TDs withing a TR). I&#8217;ve searched the web for such a function but i couldnt find one, but instead i&#8217;ve learnt a new property getElementsByTagName. With it i created the function i wanted. It&#8217;s below:</p>
<pre lang="javascript">function apply_change(row_id) {

numtds=document.getElementById(row_id).getElementsByTagName('td').length;
for(i=0;i&lt;numtds;i++) {
document.getElementById(row_id).getElementsByTagName('td')[i].style.backgroundColor='red';

}</pre>
<p>If you do not want to change the background color of all columns within a row you can modify this line</p>
<p>document.getElementById(&#8220;trb&#8221;+spc).getElementsByTagName(&#8216;td&#8217;)[i].style.backgroundColor=&#8217;red&#8217;; , so for example if you want to change the content of all columns within a row you could modify it to something like:</p>
<p>document.getElementById(&#8220;trb&#8221;+spc).getElementsByTagName(&#8216;td&#8217;)[i].innerHTML=&#8217;Briblabla&#8217;;</p>
<p>Hope this will help somebody <img src='http://seoanalytic.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://seoanalytic.com/blog/38/how-to-apply-change-to-all-tds-within-a-tr-columns-withing-a-row/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
