Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Specific cell ID content
09-23-2011, 04:29 PM #1
- Join Date
- Sep 2011
- Thanked 0 Times in 0 Posts
Specific cell ID content
Hey guys, this is probably a newbie question, but I've searched on google and didn't really find something that worked for me.
I got some rows as a result of a search query. These rows all have an unique id: row_[rownr] (for example: row_1, row_2, etc) and these rows all have some cells in it, but only one of them has an id and I want the contents of the td with that id. If this isn't possible or very hard than I can change the id to a class if that makes life easier.
What I got:
// nr is passed with the function call to select the right row
var r = document.getElementById("row_" + nr);
// I want the content of the cell with the part_nr id
var c = r.getElementById("part_nr");
// show the contents
alert("content: " + c.innerText);
09-24-2011, 03:13 PM #2
Users who have thanked DaveyErwin for this post: