Hello. I want to get data from a table. I wrote the folloing JavaScript code:
var homeTeam = document.getElementById('home').firstChild.data;
The html code for the table is:
<table>
<tr>
<td id="home"><span class='yellowcard'></span>Tottenham</td>
<td id="away">Chelsea</td>
</tr>
</table>
How is it possible to get the word 'Tottenham' in this case?
My JavaScript code is working only if 'span' tags are removed.