<?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: Javascript: Dynamically Change onclick Event</title>
	<atom:link href="http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/</link>
	<description>Web Development by Chovy</description>
	<lastBuildDate>Mon, 15 Mar 2010 02:56:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Res2</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-406780</link>
		<dc:creator>Res2</dc:creator>
		<pubDate>Mon, 01 Mar 2010 16:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-406780</guid>
		<description>how beautiful short code, thank you very much</description>
		<content:encoded><![CDATA[<p>how beautiful short code, thank you very much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: François</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-406749</link>
		<dc:creator>François</dc:creator>
		<pubDate>Mon, 01 Mar 2010 14:30:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-406749</guid>
		<description>cool! Josh
Thank a lot!
it&#039;s work (setAttribute(&#039;onclick&#039;,&#039;fonction with parameters&#039;)</description>
		<content:encoded><![CDATA[<p>cool! Josh<br />
Thank a lot!<br />
it&#8217;s work (setAttribute(&#8216;onclick&#8217;,'fonction with parameters&#8217;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-402683</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 15 Feb 2010 10:42:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-402683</guid>
		<description>Thank you Darko. Yoursolution saved a lot of work for me.</description>
		<content:encoded><![CDATA[<p>Thank you Darko. Yoursolution saved a lot of work for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-401423</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Tue, 09 Feb 2010 20:11:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-401423</guid>
		<description>el.setAttribute(‘onclick’,’showPopup()&#039;);

sorry, left off the last single quote.  You can dynamically add the onclick using .setAttribute.  Passing parameters works too.

el.setAttribute(‘onclick’,’showPopup(&#039; + someparam + &#039;)&#039;);</description>
		<content:encoded><![CDATA[<p>el.setAttribute(‘onclick’,’showPopup()&#8217;);</p>
<p>sorry, left off the last single quote.  You can dynamically add the onclick using .setAttribute.  Passing parameters works too.</p>
<p>el.setAttribute(‘onclick’,’showPopup(&#8216; + someparam + &#8216;)&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-401421</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Tue, 09 Feb 2010 20:08:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-401421</guid>
		<description>el.setAttribute(&#039;onclick&#039;,&#039;showPopup());</description>
		<content:encoded><![CDATA[<p>el.setAttribute(&#8216;onclick&#8217;,&#8217;showPopup());</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deepa</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-399695</link>
		<dc:creator>Deepa</dc:creator>
		<pubDate>Fri, 29 Jan 2010 10:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-399695</guid>
		<description>If I have to pass a variable other than &#039;this&#039; how do I go about it...

Following is the snippet

 var li = document.createElement(&quot;li&quot;);
 
li.innerHTML = &#039;&#039;+response.items[i].name; 

var URI=response.items[i].URI;

 li.onclick=    new Function(&quot;callStatus(URI)&quot;);  
 list.appendChild(li);


I get an error saying &quot;URI is undefined&quot;</description>
		<content:encoded><![CDATA[<p>If I have to pass a variable other than &#8216;this&#8217; how do I go about it&#8230;</p>
<p>Following is the snippet</p>
<p> var li = document.createElement(&#8220;li&#8221;);</p>
<p>li.innerHTML = &#8221;+response.items[i].name; </p>
<p>var URI=response.items[i].URI;</p>
<p> li.onclick=    new Function(&#8220;callStatus(URI)&#8221;);<br />
 list.appendChild(li);</p>
<p>I get an error saying &#8220;URI is undefined&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kc</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-399351</link>
		<dc:creator>Kc</dc:creator>
		<pubDate>Tue, 26 Jan 2010 17:21:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-399351</guid>
		<description>Thanks a lot!! This actually saved me a lot of time, after trying to figure out what was wrong with my onclick attribute.</description>
		<content:encoded><![CDATA[<p>Thanks a lot!! This actually saved me a lot of time, after trying to figure out what was wrong with my onclick attribute.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cat</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-399247</link>
		<dc:creator>Cat</dc:creator>
		<pubDate>Mon, 25 Jan 2010 21:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-399247</guid>
		<description>Thanks darko! Lifesaver man.</description>
		<content:encoded><![CDATA[<p>Thanks darko! Lifesaver man.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mandar</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-398993</link>
		<dc:creator>Mandar</dc:creator>
		<pubDate>Sat, 23 Jan 2010 10:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-398993</guid>
		<description>thank you buddy for suggesting call by refrence...
worked very well for me. i&#039;ve been stuck in this cupple of hrs. Solved my prob now</description>
		<content:encoded><![CDATA[<p>thank you buddy for suggesting call by refrence&#8230;<br />
worked very well for me. i&#8217;ve been stuck in this cupple of hrs. Solved my prob now</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelvin</title>
		<link>http://www.chovy.com/web-development/javascript-dynamically-change-onclick-event/comment-page-2/#comment-397600</link>
		<dc:creator>Kelvin</dc:creator>
		<pubDate>Thu, 14 Jan 2010 16:13:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.chovy.dreamhosters.com/2005/11/06/javascript-dynamically-change-onclick-event/#comment-397600</guid>
		<description>Thank you ayhtut. I spent AGES on this by trying to set the OnClick attribute - to no avail!
Your example works a treat :)</description>
		<content:encoded><![CDATA[<p>Thank you ayhtut. I spent AGES on this by trying to set the OnClick attribute &#8211; to no avail!<br />
Your example works a treat :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
