I have a markup like this:
<table id='myTable'>
<thead>
<tr>
<td>Hello</td>
</tr>
</thead>
</table>
But when I try to select the firstChild of #table
, it returns whitespace (as it is expected).
var ss = document.getElementById("myTable");
console.log(ss.firstChild);
And it returns:
<TextNode textContent="\n ">
How should I filter whitespace in getting child nodes?