Bonjour,

Dans ma table suivante lorsque je clique sur le DIV situé dans la colonne N°4 je voudrais modifier le texte de la colonne N°3 :

Si texte = on alors texte = off
Si texte = off alors texte = on

Mais je n'arrive pas à le faire... J'essaye de récupérer l'ID du TD, mais je n'y parviens pas.

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<table class="Tab">
<tr><th>COL1</th><th>COL2</th><th>COL3</th><th>COL4</th></tr>
<tr>
        <td>Ligne 1</td>
        <td id="11">11</td>
        <td>off</td>
        <td class="edit"><div onclick="change(11,this)"></div></td></tr>
<tr>
        <td>Ligne 2</td>
        <td id="12">12</td>
        <td>off</td>
        <td class="edit"><div onclick="change(12,this)"></div></td></tr>
<tr>
        <td>Ligne 3</td>
        <td id="3">3</td>
        <td>off</td>
        <td class="edit"><div onclick="change(3,this)"></div></td></tr>
</tr>
</table>

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
<div onclick="change(3,this)">
Je change juste l'image sur le onclick...