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

Fermé
myprob - 23 avril 2009 à 11:28
puxor Messages postés 318 Date d'inscription mardi 2 septembre 2008 Statut Membre Dernière intervention 4 mai 2009 - 23 avril 2009 à 14:45
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 !

3 réponses

puxor Messages postés 318 Date d'inscription mardi 2 septembre 2008 Statut Membre Dernière intervention 4 mai 2009 89
23 avril 2009 à 14:45
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
puxor Messages postés 318 Date d'inscription mardi 2 septembre 2008 Statut Membre Dernière intervention 4 mai 2009 89
23 avril 2009 à 11:28
c'est quoi la question ?
0
je ve que lé cases de table soit clickable onclick getvalue de td !
0