I have the following table. What do i need to use in JavaScript to read the number from the below cell named “number”?
<table>
<tr>
<td id="number">56656.87</td>
</tr>
</table>
I have tried the following however it does not work.
document.getElementById('number');
The
innerHTMLproperty holds the contents of that cell. If you got [object Object] on your last attempt you’re almost there. This is how you do it:Make sure there’s no other number id on that page.