J'ai besoin de trouver la position d'un élément enfant.Comment obtenir la position d'un élément enfant
j'ai une table et quand un td est cliqué, je veux la position de la td (0,1 ou 2)
<table>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
et un script comme celui-ci
<script>
$("td").click(function(){
//how do i get the position of the td?
alert("column " + columnPosition + "is clicked")
});
</script>
Trick l'élément parental dans la fixation d'un système de localisation GPS. –
@AdamDavis Cette solution ne fonctionne que lorsque l'élément enfant atteint l'adolescence. – Neil