Exp: <td> 1 </td> onclick input prend

myprob -  
puxor Messages postés 367 Statut Membre -
Bonjour,
j'ai une table dont chaque <td> prend un valeur
exp <table>
<tr><td>1</td><td>2</td><td>3</td><td>4</td></tr></table>
onclick sur td $val=1 ou 2 ou 3 ou 4
on peut dire g changé une liste déroulante par une table !
Configuration: Windows XP
Firefox 2.0.0.20

3 réponses

  1. puxor Messages postés 367 Statut Membre 89
     
    Cadeau

    <html>
    <head>
    <script type="text/javascript">
    function getValue(valeur){
            alert(valeur);
    }
    </script>
    </head>
    <body>
    <table border="1">
            <tr>
                    <td onclick="javascript:getValue(this.innerHTML)">test</td>
                    <td onclick="javascript:getValue(this.innerHTML)">test1</td>
            </tr>
    </table>
    </body>
    </html>
    
    2
  2. puxor Messages postés 367 Statut Membre 89
     
    c'est quoi la question ?
    0
  3. myprob
     
    je ve que lé cases de table soit clickable onclick getvalue de td !
    0