<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Client Side Web Development</title><link>http://forums.asp.net/130.aspx</link><description>Client-side programming discussions, including CSS, DHTML, JScript/Javascript, etc. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=18&amp;c=16" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Replace text in HTML Elem using JQuery</title><link>http://forums.asp.net/thread/3275471.aspx</link><pubDate>Sun, 05 Jul 2009 15:46:22 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3275471</guid><dc:creator>babupalladium1</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3275471.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3275471</wfw:commentRss><description>&lt;p&gt;By the way, the &amp;quot;Mark as answer&amp;quot; option is not visible in IE8.&amp;nbsp; I had to open this thread in FireFox in order to do that.&lt;/p&gt;&lt;p&gt;Babu.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Replace text in HTML Elem using JQuery</title><link>http://forums.asp.net/thread/3275462.aspx</link><pubDate>Sun, 05 Jul 2009 15:39:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3275462</guid><dc:creator>babuman1</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3275462.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3275462</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;deepthoughts,&lt;/p&gt;
&lt;p&gt;It worked.&amp;nbsp; Thank you.&lt;/p&gt;</description></item><item><title>Re: Replace text in HTML Elem using JQuery</title><link>http://forums.asp.net/thread/3274618.aspx</link><pubDate>Sat, 04 Jul 2009 12:14:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274618</guid><dc:creator>deepthoughts</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274618.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3274618</wfw:commentRss><description>&lt;p&gt;You&amp;#39;ll have to assign the changed value back to the node so that it is actually replaced. Like&lt;/p&gt;
&lt;p&gt;node[0].innerHTML=node[0].innerHTML.replace(a2.innerText, a3);&lt;/p&gt;
&lt;p&gt;Please check and let me know.&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;</description></item><item><title>Re: Replace text in HTML Elem using JQuery</title><link>http://forums.asp.net/thread/3274602.aspx</link><pubDate>Sat, 04 Jul 2009 11:46:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274602</guid><dc:creator>babuman1</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274602.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3274602</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks for the reply deepthoughts.&amp;nbsp; But my problem is the whole tag is created automatically by jsTree component which does not create an id for the anchor tag.&amp;nbsp; 
&lt;p&gt;The first line gives me the whole anchor tag.&amp;nbsp; The second line gives me the displayed text which is what I want to change.&amp;nbsp; On the third line, I modify the text.&amp;nbsp; On the fourth line, I replace the innerText with the modified text.&amp;nbsp; But when I check the variable a4 it still is equal to a1.&amp;nbsp; I tried to use the jQuery&amp;#39;s text() method with the .innerText.&amp;nbsp; But then, the whole anchor tag is replaced with just the text.&amp;nbsp; No tags. 
&lt;p&gt;var a1 = node[0].innerHTML;&lt;br /&gt;var a2 = node[0].innerText;&lt;br /&gt;var a3 = a2 + &amp;quot;(test)&amp;quot;;&lt;br /&gt;node[0].innerHTML.replace(a2.innerText, a3);&lt;br /&gt;var a4 = node[0].innerHTML;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Replace text in HTML Elem using JQuery</title><link>http://forums.asp.net/thread/3274140.aspx</link><pubDate>Sat, 04 Jul 2009 01:38:48 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274140</guid><dc:creator>deepthoughts</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274140.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3274140</wfw:commentRss><description>&lt;p&gt;Either replace the whole anchor tag like with new text. For example if you want to change &amp;quot;electronics&amp;quot; with &amp;quot;crockery&amp;quot; write something like&amp;nbsp;&lt;/p&gt;&lt;pre class="xhtml" name="code"&gt;div1.innerHTML=&amp;#39;&amp;lt;A href=&amp;quot;#&amp;quot; jQuery1246640720277=&amp;quot;25&amp;quot;&amp;gt;crockery&amp;lt;/A&amp;gt;&amp;#39;;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Or give the anchor tag an id and access it and set its innerHTML or innerText properties like&lt;/p&gt;&lt;pre class="xhtml" name="code"&gt;&amp;lt;A id=&amp;quot;a1&amp;quot; href=&amp;quot;#&amp;quot; jQuery1246640720277=&amp;quot;25&amp;quot;&amp;gt;electronics&amp;lt;/A&amp;gt;

a1.innerHTML=&amp;quot;crockery&amp;quot;;&lt;/pre&gt;
&lt;p&gt;Hope it helps&lt;/p&gt;</description></item><item><title>Replace text in HTML Elem using JQuery</title><link>http://forums.asp.net/thread/3273988.aspx</link><pubDate>Fri, 03 Jul 2009 20:35:24 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273988</guid><dc:creator>babupalladium1</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273988.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3273988</wfw:commentRss><description>&lt;p&gt;I have a jQuery jsTree on my page.&amp;nbsp; The tree works fine as expected.&amp;nbsp; I am having some trouble modifying the node&amp;#39;s title text programatically.&amp;nbsp; jsTree does not have a built-in functionality (not in 0.9.8) to do this.&amp;nbsp; So, I am trying to manually find the node&amp;#39;s innerHTML and change the title and save it back.&amp;nbsp; My innerHTML looks something like this:&lt;/p&gt;&lt;p&gt;&amp;lt;A href=&amp;quot;#&amp;quot; jQuery1246640720277=&amp;quot;25&amp;quot;&amp;gt;electronics&amp;lt;/A&amp;gt;&lt;/p&gt;&lt;p&gt;I want to change the text &amp;quot;electronics&amp;quot; to something else programatically based on some other user action.&lt;/p&gt;&lt;p&gt;When I use innerText or text() methods, I can replace the text but I loose all the other attributes of the innerHTML.&amp;nbsp; How can I preserve all the attributes of this html tag but be able to just modify the displayed text?&lt;/p&gt;&lt;p&gt;Any help please.....&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Babu.&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>