salut a tous
j'ai créé cette code qui me permet d'afficher le contenu de "tbody" lorsque je clic sur "clic"
alors mon problème je veux afficher le contenu de tbody par indice, par exemple je veux afficher que le contenu de 3éme <tr> de <tbody>
mon code:
Code : 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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 <html> <head> <script charset="utf-8" src="http://code.jquery.com/jquery-1.7b1.js"></script> <script type="text/javascript"> $(document).ready(function() { var hideEl=function() { $(".content" ).hide(); $(".enter2" ).bind('click', function() { var ele=this.parentNode; var target=$(ele).parent().next(); target.fadeIn("slow"); }); }; hideEl(); }); </script> </head> <body> <br /> <table border="1" width="500" cellpadding="0" cellspacing="0"> <thead> <tr> <th>Affiche tableau</th> <th>Le 08/08/2011</th> <th class="enter2"><a href="#">click</a></th> </tr> </thead> <tbody class="content"> <tr> <td>AA</td><td>1234</td><td>bb</td> </tr> <tr> <td>BB</td><td>1234</td><td>bb</td> </tr> <tr> <td>CC</td><td>1234</td><td>bb</td> </tr> <tr> <td>DD</td><td>1234</td><td>bb</td> </tr> </tbody> </table> </body> </html>
Partager