How to Retrive the Content of cell (<TD>

Results 1 to 3 of 3

Thread: How to Retrive the Content of cell (<TD>

  1. #1
    Join Date
    Dec 1969

    Default How to Retrive the Content of cell (<TD>

    I do have a table full with data.<BR>I would like to retrive the content of one cell (&#060;TD&#062;)<BR>into alert or varable in JS. How?...<BR><BR>thanks,<BR><BR>P.S.<BR>also I would like to change the background color of one <BR>cell whill I&#039;m chacking a "checkbox" in other cell as<BR>warnning. How to do this?...<BR>thanks <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: How to Retrive the Content of cell (<TD&

    Look up innerHTML and innerText if you are only supporting IE then you can use this with the <BR>"document.all.[objID].innerText" syntax to get and put the value of the TD. <BR><BR>I don&#039;t know much about the other browsers I&#039;m not sure it can even be done. <BR><BR>objID = the id value of the TD.<BR><BR>Hope this helps.<BR>

  3. #3
    Join Date
    Dec 1969

    Default Error in that...

    document.all["..."].innerText<BR><BR>MoserTim had an extra period after the "all". And the thing in the [ ] after .all should be a *string* (or a variable containing a string) with the ID of the object.<BR><BR>BUT...<BR><BR>But you can make this work in *most* browsers--not just MSIE--by coding<BR><BR> document.getElementById("theIDvalue").innerText<BR >or<BR> document.getElementById("theIDvalue").innerHTML<BR ><BR>That works in NS 6 and 7, as well.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts