By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,451 Members | 994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,451 IT Pros & Developers. It's quick & easy.

setting the ID for an tr-element

P: n/a
Hi group,

This seems basic to me, but I can't find the solution.

I have a table that grows tr's and td's.
At one point I have something like this:
var new_tr = tableRef.insertRow(newRowNum);

How can I give this new tr (new_tr) an ID that can be referenced by means of
getElementById() ??

I hoped for something like:
new_tr.setID("row20");
but that doesn't fly. :-/

Thanks for your time.

Regards,
Erwin Moller
Jun 30 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Erwin Moller wrote:
Hi group,

This seems basic to me, but I can't find the solution.

I have a table that grows tr's and td's.
At one point I have something like this:
var new_tr = tableRef.insertRow(newRowNum);

How can I give this new tr (new_tr) an ID that can be referenced by means of
getElementById() ??

I hoped for something like:
new_tr.setID("row20");


new_tr.id = "row20";

--
Ian Collins.
Jun 30 '06 #2

P: n/a
Ian Collins wrote:
Erwin Moller wrote:
Hi group,

This seems basic to me, but I can't find the solution.

I have a table that grows tr's and td's.
At one point I have something like this:
var new_tr = tableRef.insertRow(newRowNum);

How can I give this new tr (new_tr) an ID that can be referenced by means
of getElementById() ??

I hoped for something like:
new_tr.setID("row20");


new_tr.id = "row20";


Wow, I knew it had to be simple. :-)

Thanks for your quick response!

Regards,
Erwin Moller
Jun 30 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.