Hi,
my html code is :
<div style="position:absolute;top:10px;left:10px">
<table>
<tr>
<td id="TdBarreBouton1">
<hr>
</td>
</tr>
<tr>
<td id="TdBarreBouton2">
<button id="btn_inserer">Bouton</button>
</td>
</tr>
</table>
</div>
I want to know the postion of the button.
My javascript code is :
boutonInserer = document.all.btn_inserer;
pos_left = document.all.TdBarreBouton2.offsetLeft +
boutonInserer.offsetLeft;
pos_top = document.all.TdBarreBouton2.offsetTop +
boutonInserer.offsetTop;
But, the problem is if I move the button in the TD (id=TdButton1), I
MUST change the javascript code.
Is it possible to calculate the position of the button without
indicating the name of the TD in the javascript code ?
Thanks.