File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes specific TD value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "specific TD value" Watch "specific TD value" New topic

specific TD value

Vrunda Joshi
Ranch Hand

Joined: Dec 03, 2001
Posts: 104
in my application i am having table with parent /child relation.on click of a cell in parent table i am displaying respective child table.this works fine,
but now the prob is,when i click on a row in parent table,i want to retreive value of only first cell which is the primary key for child table.
if i do .innerText to the <TR> i get all the column values.
is there any way out to this?i want this to work out in both IE and Netscape
this is a bit urgent
thanks in advance
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
If var trRef is point to your TR,
than trRef.firtsChild will point to first TD. It should work in NS6 and IE5.5+
Or, you could assign id to your TR tags, and to first TD in TR, so knowing id for TR you can get id for corresponding TD, and use document.getElementByID()
Vrunda Joshi
Ranch Hand

Joined: Dec 03, 2001
Posts: 104
thanks a lot Yuriy Fuksenko,i will try to work it out
-Vrunda divekar
I agree. Here's the link:
subject: specific TD value
jQuery in Action, 3rd edition