Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replace text in the <TD> ?

 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All ,


I have 2 <TD> with same ID , so I want to change the text in the second TD .

I tried innerHTML but it was replacing first TD's text .

I want to get second TD and change it's text .

Please suggest if anyone has faced such a issue....


Thanks in advance....


- Chetan
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having two of the same id values in one page is invalid. Fix that problem.
 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah completely agreed Bear , But i am working on one product which internally create this type of the structure and is applicable to every screen and every Table TD in it .

But yes i resolved i have one extra hidden field in second TD so i found Parent of that field and then set InnerHTML .


Thanks.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic