Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > insertRow and id tag

Reply
Thread Tools

insertRow and id tag

 
 
Christopher Berg
Guest
Posts: n/a
 
      11-09-2006
hi.
is there a way to add an id='...' tag to a table row when using
the javascript insertRow() ?

i wish to be able to manipulate this row later if i need to
using that identifier (eg to toggle its display style).

thank you.

 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      11-10-2006

Christopher Berg wrote:
> hi.
> is there a way to add an id='...' tag to a table row when using
> the javascript insertRow() ?


You mean add an id attribute? Yes, insertRow returns a reference to the
newly created row:

<URL: http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-39872903 >

var newRow = tableSection.insertRow(-1);
newRow.id = 'someUniqueID';


> i wish to be able to manipulate this row later if i need to
> using that identifier (eg to toggle its display style).


That seems to indicate that you will use getElementById. Consider
other methods, say keeping references to rows in an object or array, or
use an intrinsic event - they may be more robust and faster.


--
Rob

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you make them table insertRow and insertBefore (element) worktogether? DL Javascript 3 05-31-2008 12:39 PM
Alternative for insertRow and insertCell, which is are supports in Firefox raju78.k@gmail.com Javascript 1 01-17-2007 11:36 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
IE SP2 solution for "null is null or not an object" and "broken" insertCell/insertRow putty Javascript 1 04-05-2005 07:11 PM
InsertRow() and rowIndex Marco Alting Javascript 3 08-20-2003 07:22 AM



Advertisments