Wrox Programmer Forums
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 22nd, 2006, 04:27 AM
Authorized User
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Change data of <TD>

Can the data of a <TD> tag of a <TABLE> be changed dynamically when i require it. If so can u tell me how.


Old July 25th, 2006, 07:32 PM
Friend of Wrox
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts

Give the TD element an ID. e.g. <td id="foo">mytext</td>. Then in Javascript, run

document.getElementById("foo").innerText = "new text!";

Jon Emerson
Old July 28th, 2006, 04:09 AM
Authorized User
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts

hi thanks but the document.getElementById() works only in IE and not in netscape. can u tell me of a common code for this

Old July 28th, 2006, 05:32 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

What version of Netscape are you using?

document.getElementById is *not* IE only; most modern browsers will understand it....


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixing <TD> size. rupen HTML Code Clinic 4 April 28th, 2006 07:41 AM
change <td> value onClick crmpicco Javascript How-To 2 August 23rd, 2005 07:31 AM
XML into <td> crmpicco Classic ASP Basics 4 February 11th, 2005 09:57 AM
using variables within <td> tags handyman Javascript How-To 3 June 15th, 2004 11:18 PM
space creeping into <td> elements mountainbiker XSLT 3 January 28th, 2004 03:30 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.