Code2care : TechZone Apps & Tutorials

How to get table td, tr or th inner content value with id or name attribute

Here is how we can get the value from a table element like td, th or tr having id or name attribute.

<table>
<tr>
<td id="td_tag">Test</td>
</tr>
</table>
For the above td tag we can get the inner content by,

document.getElementById("td_tag").innerText;

or,

document.getElementById("td_tag").textContent;
















Popular tags
android
x 175
eclipse
x 29
notepadplusplus
x 20
macosx
x 14
sharepoint
x 14
html
x 14
mac
x 13
androidstudio
x 11




1000+ C Programs     PHP Tutorial     JSON Tutorial     Swift Tutorial     India Pinocdes     About Us     Privacy Policy


Code2care © 2012-17