![]() |
Cell Coordinates & InnerText
Hi,
I would like to SET input areas with cell data. The problem I'm having, however, is that I cannot find a way to get a specific cell's content. I would like something like this: Code:
var x=1;Thanks a lot, Ashton. |
You haven't mentioned anything about a specific JavaScript framework, so I'm not sure why you selected this subforum. You may want to ask a moderator to move it up to the top-level JavaScript forum so you get more responses.
Try assigning a location-specific ID to each cell and then using getElementById to find it. Something like this: Code:
<!-- IDs must start with a letter or underscore --> |
You see, I cannot set Id's because the table rows are dynamically generated and there will be an X amount. Is there no way of doing something similar to the line of code I mentioned above?
Code:
inputArea ABC = document.getElementById("MYTABLE")[x][y].innerText; |
Quote:
Quote:
Code:
/*edit me to fit your needs*/ |
Nevermind, I found the solution:
Code:
<html>Is there a better way to retrieve cell data than innerHTML ? I tried "data" but it returns "[object]"... When I use innerHTML it returns the html tags, along with the text, and I only want the text... Thanks. |
| All times are GMT +1. The time now is 04:55 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.