473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

setting the ID for an tr-element

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
2 1635
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tamer Higazi | last post by:
Hi! I wrote a small script setting a cookie.... but nothing is being set. What could be the problem?! Did I make something wrong?! One script is used to ask for the cookie and the other one shows...
2
by: Charleees | last post by:
Hi all, I have a DataGrid with Template Columns..... There are LAbels,Linkbuttons in the Single Row.. I have to set the Constant Column width for those Template Columns in Grid... Wat...
5
by: jose1lm | last post by:
What is supposed to happen: A user enters data into one of the FORM input selections. When the user submits the form, the onclick event is supposed to go to a function that will set another FORM...
8
by: SpiritBreaker | last post by:
I am having problems getting the $_SESSION to set, the $_SESSION will work fine when its first gets the value, however, when I go to another page, the $_SESSION then loses its value. So if any one...
1
by: Jeff | last post by:
I tend to be a bit behind the times, sometimes a generation further that I want. So, I've been thing about the "*" selector. I've noticed that unlike body, it styles form fields and form...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.