thead=table.getElementsByTagName('thead');
thMio=thead.item(0).getElementsByTagName('tr');
getElementsByTagName ritorna una lista di nodi ai quali puoi accedere con item