JSFiddle - React, Tailwind, and code Playground

by patrick29

HTML

<table>
<caption>Résultats de la recherche</caption>
	<thead>
		<th id='premiere_cellule'></th>
		<th>01/03</th>
		<th>02/03</th>
	</thead>
	<tbody>
		<tr>
			<th>14/02</th>
			<td>860.20</td>
			<td>860.20</td>
		</tr>
		<tr>
			<th>15/02</th>
			<td>860.20</td>
			<td>860.20</td>
		</tr>
	</tbody>
</table>

JavaScript

$('td').mouseover(function() {
	var dateAller = $(this).siblings().eq(0).text();
	alert(dateAller);

	var colonneIndex = $(this).index();
	var dateRetour = $('table thead th').eq(colonneIndex).text();
	alert(dateRetour);
});