Nevermind, I found the solution:
Code:
<html>
<head><title></title></head>
<body>
<script type="text/javascript">
function getRow(t) {
var col=t.cellIndex;
var row=t.parentNode.rowIndex;
var testTable = document.getElementById("testTable");
alert(testTable.rows[row].cells[col].innerHTML);
}
</script>
<table id="testTable" border='1' style="background-color:black; color:white">
<tr>
<td width='150px' onclick="getRow(this)">
test 1
</td>
<td onclick="getRow(this)">
<b>Test B</b>
</td>
</tr>
<tr>
<td width='150px' onclick="getRow(this)">
test 2
</td>
<td onclick="getRow(this)">
<b>Test B</b>
</td>
</tr>
</table>
</body>
</html>
My only question now is:
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.