I am having trouble retrieving the value for <td>
Value3
How can I navigate through this DOM to extract the value from <td>
?
<table>
<thead>
<tr>
<th col="value2"></th>
</tr>
</thead>
<tbody>
<tr id="value1">
<td>Value3</td>
</tr>
</tbody
<table>
I have been using the following code snippet to access other attributes, but unable to get the value of <td>
:
"row_id": this.parentNode.getAttribute('id'),
"id": this.getAttribute('id'),
"name": this.getAttribute('row'),
"project": this.getAttribute('value'),
"column": oTable.fnGetPosition( this )[2]
I attempted the below along with several other methods without any success
$(table tbody tr td).value
document.getElementsByTagName('tr').getAttribute('value')
The table is dynamically created using JSTL as shown below.
<c:forEach var="column" items="${row}">
<td><c:out value="${column}"/></td>
</c:forEach>